報錯如下:
Property or method “xxx” 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.
屬性或方法“xxx”不是在實例上定義的,而是在呈現期間引用的。通過初始化該屬性,確保該屬性是反應性的,無論是在data選項中,還是在基於類的組件中。
原因:
“xxx”在template或方法中使用了,但是沒有在data中定義
解決:
export default {
data(){
return{
xxx:""
}
},
}