一、动态反复切换样式
<view class="status">
<view class="statusCard" v-for="(item, index) in statusCard" :key='index'>
<image
:src="item.successUrl"
:class="index===activeCardIndex.indexOf(index)!=-1?'currentimg':' '"
@click="navigateCard(item.navigateUrl,index)"
>
</image>
</view>
</view>
navigateCard(url,index){
if(url!=" "){
var that = this;
uni.navigateTo({
url:url
})
if(this.activeCardIndex.indexOf(index)==-1){
this.activeCardIndex.push(index)
}
else{
this.activeCardIndex.splice(this.activeCardIndex.indexOf(index),1)
}
}
}