data(){
return{
checkedData:[],
//联赛列表
issueMatch:[]
};
},
然后在模板里
<view class="bet-btn" :class="{'on':checkedData[item.id].indexOf('3')>-1}">
ID:{{item.id}}
</view>
报错:
Property or method "item" 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:
是由 checkedData[item.id].indexOf('3')>-1 引起的,删掉就不报错了
dhb (作者)
item 变量 是循环出来的呀, 代码没有截全, 解决了,<view> 不是对象,也就无法使用对象, vue的解释是这么说的
2019-05-04 12:01