vue 点击当前元素改变样式
template
<ul> <li v-for="(relation,index) in relations" v-bind: v-bind: v-bind:class="{checked:index==nowIndex}" v-on:click="relationClick(index)"> <i> </ul>
data
nowIndex:0
methods
changeValue(index){ this.isActive=index; }`
style
.checked{ background: #eff4f7; }