<div v-for="(item, index) in configTypeList" @click="activeChange(item, index)" class="docTag search_part_left" :class="{ activeTag: docTypeActive == index + 1 + '' }" :key="index">{{ item.label }} </div>
activeChange(e, i) {
this.docType = e.value;
switch (i) {
case 0:
this.docTypeActive = '1';
break;
case 1:
this.docTypeActive = '2';
break;
case 2:
this.docTypeActive = '3';
break;
case 3:
this.docTypeActive = '4';
break;
case 4:
this.docTypeActive = '5';
break;
}
},
.docTag {
padding: 0 16px;
height: 32px;
background: #ffffff;
border: 1px solid #d9d9d9;
border-radius: 3px;
margin-right: 8px;
font-size: 14px;
line-height: 32px;
color: #595959;
cursor: pointer;
float: left;
}
.activeTag {
color: #0d8eff;
border-radius: 3px;
border: 1px solid #0d8eff;
}
.search_part_left {
float: left;
}
css 点击按钮,切换颜色
于 2024-07-19 17:13:16 首次发布