循环按钮多选

<view class="tabs_currency">
                <view :class="addcurrencyList.includes(index)?'select':''" @tap="addcurrencylist(index)"
                    class="tabs_list" v-for="(item,index) in tabs_list" :key="item.name">
                    {{item.name}}
                </view>
            </view>
addcurrencylist(index){
				let i = this.addcurrencyList.indexOf(index);
				if(i == -1){
					this.addcurrencyList.push(index)
				}else{
					this.addcurrencyList.splice(i,1)
				}
				
			},

  

posted @ 2021-12-30 16:51  启豪  阅读(34)  评论(0)    收藏  举报