当前位置: 移动技术网 > IT编程>脚本编程>vue.js > vue实现鼠标移入移出事件代码实例

vue实现鼠标移入移出事件代码实例

2019年07月23日  | 移动技术网IT编程  | 我要评论

寻根问底,嫡一妻,cz672

本文实例为大家分享了vue实现鼠标移入移出事件的具体代码,供大家参考,具体内容如下

<div class="index_tabletitle clearfix" v-for="(item,index) in table_tit">
     <div class="indexitem">
      <span :title="item.name">{{item.name}}</span>
      <span class="mypor">
       <i class="icon" @mouseenter="enter(index)" @mouseleave="leave()"></i>
       <div v-show="seen&&index==current" class="index-show">
        <div class="tip_wrapinner">{{item.det}}</div>
       </div>
      </span>
     </div>
    </div>
export default {
  data(){
   return{
    seen:false,
    current:0
   }
  },
  methods:{
   enter(index){
    this.seen = true;
    this.current = index;
   },
   leave(){
    this.seen = false;
    this.current = null;
   }
  }
 }
 

以上所述是小编给大家介绍的vue实现鼠标移入移出事件详解整合,希望对大家有所帮助

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网