vue监听$route变化,报错:
Error in callback for watcher “$route”: “TypeError: Cannot read property ‘call’ of undefined”
watch
: {
$route
: function(newV
) {
console
.log(newV
)
if (newV
.path
== '/welcome') {
this.activeStatus
= ''
}
}
}
解决方法
检查函数function是否在method下面
newV
.path
== '/welcome'
转载请注明原文地址: https://lol.8miu.com/read-37615.html