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);
}
网友评论