Vue 鼠标移入移出 样式改变

  • Post author:
  • Post category:vue


<div v-for="(item, index) in 3" :key="index">
  <a @click="goList(index)" @mouseover="getCur(index, item)" :class="curIndex == index ? 'current' : ''">
    <span>{{ item}}</span>
  </a>
</div>
// tab滑动
getCur(a, b) {
  if (a == 0) {
    this.curIndex = 0;
  } else if (a == 1) {
    this.curIndex = 1;
  } else {
    this.curIndex = 2;
  }
},
// tab 点击事件
goList(a) {
  if (a == 0) {
    this.$router.push("******"); 
  } else if (a == 1) {
    this.$router.push("****");
  } else {
    // *********
  }
},



版权声明:本文为weixin_58346650原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。