1.点击时候让当前元素的class判断条件为真
<ul> <li :class="{'active': index === selected }" v-for="(item, index) in list" @click="choose(index)"></li> </ul>
new Vue({ el:'.top_bar', data:{ selected: null }, methods:{ choose:function (index) { this.selected = index } } });