如图,鼠标移入移出改变背景
1.绑定事件:
<div class="indent" @mouseover="mouseOver($event)" @mouseleave="mouseLeave($event)">
2.js(通过增加一个class name)
mouseOver($event){ $event.currentTarget.className = "indent active"; }, mouseLeave($event) { $event.currentTarget.className = "indent"; },
3.CSS(自己想要的样式)