<cover-view class="root">
<cover-view wx:for="{{tabBar.list}}" data-index="{{index}}" class="tabView" bindtap="btnTab">
<cover-image class="imgView" src="{{item.iconPath}}"></cover-image>
<cover-view class="txtView">{{item.text}}</cover-view>
</cover-view>
</cover-view>
methods:{
btnTab(e){
let index = e.currentTarget.dataset.index
let tabBar = this.data.tabBar
tabBar.list[index].src = tabBar.list[index].selectedIconPath
this.setData({
tabBar:tabBar
})
console.log('index',index);
console.log('tabBar',this.data.tabBar);
},
},
为什么data中的数据改变了,视图并没有做出改变啊