Vue报错:Property or method “x“ is not defined on the instance but…以及Invalid handler for event “click“

一下报了四个错误:

 Property or method "myprice" 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.

Invalid handler for event "click": got undefined

Error in nextTick: "TypeError: Cannot read properties of undefined (reading '_withTask')"

Cannot read properties of undefined (reading '_withTask')

如图:

 结果:是因为methods拼写错误。

查错过程:

1、引起错误的几种原因

(1)函数没有写到methods中去

(2)调用的函数没有定义

(3)调用的函数名写错了

2、排查

发现methods拼写错误。

猜你喜欢

转载自blog.csdn.net/qq_56715703/article/details/130917626
今日推荐