0👍
I already have a similar problem because computed had to have a setter and a getter like this :
computed: {
fullName: {
// getter
get: function () {
return this.firstName + ' ' + this.lastName
},
// setter
set: function (newValue) {
var names = newValue.split(' ')
this.firstName = names[0]
this.lastName = names[names.length - 1]
}
}
}
- [Vuejs]-How to properly format an image url in a Vue.js single-file-component?
- [Vuejs]-Why does Jest throw an error on dynamic import() when calculating coverage for a Vue.js app?
Source:stackexchange.com