vue中默认传递event方法

2020-12-11  本文已影响0人  三月木头

1.在vue中普通方法中默认带有event DOM事件


<div class="percent-slider__dot--selected"
        :style="wrapperStyle"
        @touchstart="onButtonDown">
</div>

onButtonDown(event: Event) {
        event.preventDefault();
        this.onDragStart(event);
        window.addEventListener("touchmove", this.onDragging);
        window.addEventListener("touchend", this.onDragEnd);
        window.addEventListener("contextmenu", this.onDragEnd);
 }
上一篇 下一篇

猜你喜欢

热点阅读