Propertyormethod“id”isnotdefinedontheinstancebutreferencedduringrender.Makesurethat转载
原创报错详情
**[Vue warn]: Property or method “id” 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. See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.**
报错原因
由于Vue不允许动态添加根级反应属性,因此必须通过预先声明所有根级反应数据属性进行初始化。Vue实例,即使它为空:
如果未在数据选项中声明,Vue系统将警告您呈现功能正在尝试访问不存在的属性。
这一限制背后有技术上的原因。 - 它消除了依赖跟踪系统中的一类边缘情况,并使Vue实例在类型检查系统中发挥着更好的作用。但在代码可维护性方面也有一个重要的考虑因素: data 对象就像组件状态中的模式。所有反应属性的预声明使组件代码在以后被其他开发人员重新访问或读取时更容易理解。
解决办法
再data介质名称变量
data:{ id:"id" },
版权声明
所有资源都来源于爬虫采集,如有侵权请联系我们,我们将立即删除
itfan123



