vue组件监听属性变化watch方法报[Vue warn]: Method "watch" has type "object" in the component definition. Did you reference the function correctly?

含义:[Vue warn]:方法“watch”在组件定义中类型为“object”。你正确地引用了函数吗?

 其实我也不知道这个是啥意思

我查了下有两种产生这种警告的问题

1. watch方法什么都没写

 解决办法:删除就行了,这种没有测试过,暂时没时间测试

2.是watch方法写在了method中,这个是我遇到的

解决办法,将watch方法写在与method同一级别,警告就消除了

原文地址:https://www.cnblogs.com/cuteCoderSnow/p/13705701.html