VueJS: viewing two properties
1 answer
Keep track of the calculated value.
computed:{
combined(){
return this.a && this.b
}
}
watch:{
combined(value){
if (value)
//do something
}
}
There is some short hand for the above using $ watch .
vm.$watch(
function () {
return this.a + this.b
},
function (newVal, oldVal) {
// do something
}
)
+6
source to share