touch-手势操作

原生实现移动端常见手势

长按 long-press

1
<div v-show="popIndex == 3" class="pop-outlook" @touchstart="closeHandle('down')" @touchend="closeHandle('up')">
1
2
3
4
5
6
7
closeHandle (state) {
if (state == 'down') {
this.mouseHandleClick = new Date().getTime()
} else if (new Date().getTime() - this.mouseHandleClick <= 300) {
this.close()
}
},