vue·鼠标指向时触发方法函
1】div 注意enter名称是固定的否则报错
<div class="link" @mouseenter="enter(1)" @mouseleave="leave(1)">移入鼠标触发</div> <div class="link" @mouseenter="enter(2)" @mouseleave="leave(2)">鼠标触发</div>
2】methods(常用写法)
enter(e) { console.log("enter"+e) }, leave(e) { console.log("leave"+e) }
950 Views