@computed js code example
Example 1: computed setter
// ...
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]
}
}
}
// ...
Example 2: js computed style
// window.getComputedStyle(<element>).<css-attribute>
// example :
window.getComputedStyle(document.getElementById("11")).width