vue 点击当前元素改变样式

Posted ssjf

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了vue 点击当前元素改变样式相关的知识,希望对你有一定的参考价值。

template

 <ul>
   <li v-for="(relation,index) in relations" v-bind:id="relation.id" v-bind:id="relation.id" 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;
 

原文:https://www.jb51.net/article/146114.htm

以上是关于vue 点击当前元素改变样式的主要内容,如果未能解决你的问题,请参考以下文章