< div class= "section_content_coupon_right_btn": data-id= "row1.id" >
<span v-bind:class="{active:arr[index]}"
v-if="!isactive[index]"
@click="getcoupons(index,$event)"
:data-id="row1.id">{{btntext}}</span>
<span v-if="isactive[index]">{{btntext1}}</span>
</div>
above is the page code
below is the JS method
getcoupons:function(index,event){
//this.$set(app.isActive[index], index, true);
console.log(app.isactive)
console.log(index)
let e=event;
console.log(e);
app.isactive[index]=[];
app.isactive[index]=true;
console.log(app.isactive)
if(app.phone===""||app.email===""){
app.getzz = true;
app.getThisPath1 = true;
let workId = e.currentTarget.dataset.id;
app.workId=workId;
return;
}else if(app.phone!==""&&app.email!==""){
app.getzz = false;
app.getThisPath1 = false;
let workId = e.currentTarget.dataset.id;
app.workId=workId;
/*app.isactive[index]=true;*/
app.query1(e);
return;
}
},
it"s no good to write like this. Is there a big god to change it?