Property or method “id“ is not defined on the instance but referenced during render.Make sure ......

Vue报错: 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.

报错解释:Property or method “id“ is not defined on the instance but referenced during render.Make sure ......_第1张图片


报错截图:

Property or method “id“ is not defined on the instance but referenced during render.Make sure ......_第2张图片

Property or method “id“ is not defined on the instance but referenced during render.Make sure ......_第3张图片


报错分析:

  • 参考博客:点击前往

解决办法:

data中定义变量 id 以声明变量,即可解除报错。

Property or method “id“ is not defined on the instance but referenced during render.Make sure ......_第4张图片

代码如下:

data: {
     
	id: '',
}

以上就是关于“ Property or method “id” is not defined on the instance but referenced during render.Make sure … ” 的全部内容。

你可能感兴趣的:(vue.js踩坑篇,Vue.js)