默认选中
tableA: 0,
html
<table class="test-table" cellspacing="0">
<thead>
<tr>
<th
v-for="(v,i) in ['全部监控','全部监控','全部监控','全部监控','全部监控']"
:key="i"
@click="tableA=i"
:class="tableA==i?'adidas':(tableA-1)==i?'nike':''"
>{{v}}</th>
</tr>
</thead>
</table>
css
.test-table {
margin-top: 50px;
border-collapse: collapse;
th {
padding: 5px 10px;
border: 1px solid lightgray;
}
.adidas {
border-color: red;
}
.nike {
border-right-color: red;
}
}