【Vue】Property or method “xxx” is not defined on the instance but referenced during render.
Property or method “data” is not defined on the instance but referenced during render. Make sure that this property is reactive, either in the data option, or for class-based components, by initializi
·
Property or method “data” is not defined on the instance but referenced during render. Make sure that this property is reactive, either in the data option, or for class-based components, by initializing the property.
属性或方法“data”不是在实例上定义的,而是在呈现时引用的。通过初始化该属性,确保该属性是反应性的,无论是在data选项中,还是在基于类的组件中
原因: “xxx”在template或方法中使用了,但是没有在data中定义
解决: 在引用组件时,先在data里定义一下组件。
更多推荐
已为社区贡献2条内容
所有评论(0)