el-carouse
組件是自帶鼠標事件,要修改則需要清除原有事件,即鼠標的移入事件@mouseenter.native="delHandleMouseEnter"
。
<el-carousel ref="carousel" trigger="click" arrow="always" height="1060px"
@change="changehandle" @mouseenter.native="delHandleMouseEnter">
方法:
delHandleMouseEnter() {
this.$refs.carousel.handleMouseEnter = () => { };
},
但是,這樣在第一次鼠標進入是還是無法觸發handleMouseEnter
事件,這只需要在mounted()
方法中添加上this.$refs.carousel.handleMouseEnter = () => { };
就可以了。
通過以上的處理,就可以取消鼠標懸停不自動切換的問題,但是也就不能讓切換停止了。