当前位置:   article > 正文

解决vue报错(Property or method “main“ is not defined on the instance but referenced during render. Make)

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

在写案列的时候,不知道怎么回事就忽然报了一个错,虽然不影响整体的效果,但是有个报错,总让人感觉不舒服。在这里就说说报错的解决方法

报错如下
Property or method “main” 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.

翻译后的结果

属性或方法“main”未在实例上定义,但在呈现期间被引用。通过初始化属性,确保此属性是被动的,无论是在data选项中,还是对于基于类的组件。

总结报错的原因都有:

  • 单词写错
  • 未定义
  • 。。。。

有错误请查看
你的“”xxx‘’属性或者"xxx"方法没有定义,查看你的data或者methods或者prop

解决方法

export default {
 data(){
  return{
    xxx:""
  },
 methods:{
    xxx(){}
 }
 },
}
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/知新_RL/article/detail/315815
推荐阅读
相关标签
  

闽ICP备14008679号