我有一个具有以下散列的组件
{
computed: {
isUserID: {
get: function(){
return this.userId?
}
}
}我应该关注isUserID或userId的变化吗?你能观察计算的属性吗?
发布于 2016-12-15 21:39:43
发布于 2017-06-02 17:33:08
computed: {
name: {
get: function(){
return this.name;
}
}
},
watch: {
name: function(){
console.log('changed');
}
}这样,如果计算属性发生更改,我们可以在控制台上得到通知。
https://stackoverflow.com/questions/41067378
复制相似问题