页面报错显示:[Vue warn]: Error in callback for watcher “formManageDevice”: “TypeError: Cannot read property ‘call’ of undefined”,翻译过来为监视器“xx”的回调错误:“TypeError:无法读取未定义的属性‘call’”
出现问题的代码如下:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | [Vue warn]: Error in callback for watcher "formManageDevice": "TypeError: Cannot read property 'call' of undefined" formManageDevice: { list: '' }, formManageDevice: { list (e) { //根据值切换弹出框 console.log(e) this.configModelStatus = e.list if (e.list === '') { this.configModelStatus = 'OFFICE' } else if (e.list === 'Outlets at Castle Rock') this.configModelStatus = 'OUTLETS' }, deep: true } |
这里出现问题的原因就是深度监控中的函数名和变量名重复了,这在vue中,是不可取的,所以会抛出一个无意义的错误
7