<ul class="accountlist">
<li v-for="(item,index) in bankcardData" :key="index" @click="curindex === index" :class="curindex === index ? 'active' : ''">
<i class="icon-corner corner" v-if="curindex === index"></i>
<span class="textcenter">{{item.bankName}}</span>
<p class="card-number textleft">{{item.accountNo}}</p>
<div class="anchor">
<button class="textleft btn default-btn" @click="activestyle($event,index)" :class="curindex === index?'opacity':''">设置默认</button>
<button class="textright cancel-btn" v-popover:popover>解除绑定</button>
</div>
</li>
</ul>
setDefault(){
var self = this;
$('.accountlist').on('click', '.default-btn', function() {
var curli = $(this).parents('li');
$('.accountlist').prepend(curli);
var curliIndex = curli.index();
console.log(curliIndex); //curliIndex 当前下标 点击任何一个li都为 0下标
post(self,api.setDefault,self.setDefaultList,(response)=>{
self.getEntBank();
})
});
},
梦里花落0921
相关分类