Skip to content

Instantly share code, notes, and snippets.

@titandiaz
Created August 26, 2019 17:04
Show Gist options
  • Save titandiaz/c40d9e34a3b4b544ce896310fb37aaf9 to your computer and use it in GitHub Desktop.
Save titandiaz/c40d9e34a3b4b544ce896310fb37aaf9 to your computer and use it in GitHub Desktop.
computed: {
citiesWithPayOnDelivery() {
if (this.paymentMethods[0] && this.paymentMethods[0].valores !== '') {
return JSON.parse(this.paymentMethods[0].valores)
}else {
return []
}
},
cityLabelsWithPayOnDelivery: {
get() {
return this.citiesWithPayOnDelivery.map(city => {
return this.cities.find(item => item.id == city);
})
},
set(newValue) {
console.log(newValue)
}
},
paymentMethods: {
get() {
return this.$store.state.paymentMethods;
},
set(newValue) {
this.$store.state.paymentMethods = newValue;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment