`
methods: {
change(){
this.$route.params.data1 = 1;
// 下面这种手动set的方式也不能触发watch对$route的监听
// this.$set(this.$route.params, data1, 1);
}
},
watch: {
$route: {
handler(newName, oldName) {
console.log('$route has changed');
},
deep: true
}
`
当触发change事件时,在vue-tool中可以观测到data中的$route中的params数据确实是变化的,但是仍然watch不到$route的变化。请问这个什么个情况?(而且console出来看,$route确实没有__ob__属性,即使手动调用this.$set()这种方式也不行。。。)### 问题描述
问题出现的环境背景及自己尝试过哪些方法
相关代码
// 请把代码文本粘贴到下方(请勿用图片代替代码)