vue实现移入移出事件
Html
<i class="icon" @mouseenter="enter(index)" @mouseleave="leave()"></i>
JS
methods:{ enter(index){ this.seen = true; this.current = index; }, leave(){ this.seen = false; this.current = null; } }
Html
<i class="icon" @mouseenter="enter(index)" @mouseleave="leave()"></i>
JS
methods:{ enter(index){ this.seen = true; this.current = index; }, leave(){ this.seen = false; this.current = null; } }