问题描述
在写vue项目时:
控制台信息:
Property or method “incrementOdd” 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
原因分析:
可能的原因:
1、函数没有写在methods里
看看是不是直接写到组件的定义里去,或是写到data里面去了。
2、调用的函数没有定义或者函数名写错了
@click=‘xxx’,看看这个xxx有没有定义,是不是写错了