1 回答
TA贡献1757条经验 获得超8个赞
.row
p 财经新闻:
.buttonsRight
.item(v-for="(item,index) in taxData.caijing"
:class="taxDataForm.caijing.includes(item)?'active':''"
@click="handclick('caijing',item)") {{item}}
.row
p 热点聚焦:
.buttonsRight
.item(v-for="(item,index) in taxData.redian"
:class="taxDataForm.redian.includes(item)?'active':''"
@click="handclick('redian',item)") {{item}}
.row
p 行业资讯:
.buttonsRight
.item(v-for="(item,index) in taxData.hangye"
:class="taxDataForm.redian.includes(item)?'active':''"
@click="handclick('hangye',item)") {{item}}
methods:{
handclick(str,item){
let arr;
if(this.taxDataForm[str]){
arr = this.taxDataForm[str]
}else{return}
arr.includes(item)?this.taxDataForm[str]=arr.filter(a=>a!==item):arr.push(item)
}
}
添加回答
举报