在使用vue时由于粗心遇到了一些问题,记录一下。

Property or method “addToReciveObjectList” 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.

意思是:方法“addToReciveObjectList”未定义但是却在组件渲染的时候引用了它。

如图:

Property or method "addToReciveObjectList" is not defined on the instance but referenced during rend

最终调试后发现,是因为我的addToReciveObjectList方法没有放在methods里面,组件渲染时找不到该方法,所以会报错。

如图:methods外的方法都会有该问题,将它们放到methods内就可以了。Property or method "addToReciveObjectList" is not defined on the instance but referenced during rend

相关文章:

  • 2021-09-14
  • 2021-09-21
  • 2022-12-23
  • 2021-09-16
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-01-23
  • 2022-12-23
  • 2021-08-21
  • 2021-08-19
  • 2021-07-02
  • 2021-12-03
  • 2021-07-22
相关资源
相似解决方案