有可能$watch
Vue $refs
吗?
我想针对嵌套在当前Vue实例中但在ready
回调中的子组件设置逻辑,$refs.childcomponent
在处理时最初是undefined
.
inside 100
this.$watch('$refs', function() {
console.log("not firing");
}, { deep: true });
结果:错误:超过最大调用堆栈
100 property of the instance
watch: {
'$refs': {
handler: function() { console.log("hit"); },
deep: true
}
}
结果:什么都没有.