当前位置:   article > 正文

vue 报错未在实例上定义“”,但在渲染过程中引用了该属性_is not defined on the instance but referenced duri

is not defined on the instance but referenced during render. make sure that

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.(未在实例上定义“”,但在渲染过程中引用了该属性。请通过初始化该属性,确保该属性在“数据”选项中或对于基于类的组件是被动的。)

在vue html中使用一些变量 报错:渲染过程中使用了该属性,但是没有初始化 该属性 确保该属性在“数据”选项中或对于基于类的组件是被动的。

在这里插入图片描述
在html中使用了一个变量height 但是报错说没有实例中定义 两种解决方案

1就是在 data rerun中添加一个height

2在props里面添加一个height

height:{
   type: Number,
   default: null

}
  • 1
  • 2
  • 3
  • 4
  • 5
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/从前慢现在也慢/article/detail/315787
推荐阅读
相关标签