Vue移动端左右滑动

1.安装vue-touch(https://github.com/vuejs/vue-touch/tree/next

cnpm install vue-touch@next --save

2.在main.js使用

import VueTouch from 'vue-touch'
Vue.use(VueTouch, {name: 'v-touch'})
VueTouch.config.swipe = {
      threshold: 100 //手指左右滑动距离
}

3.代码使用

<v-touch v-on:swipeleft="onSwipeLeft" v-on:swiperight="onSwipeRight"  tag="div" style="touch-action: pan-y!important">
        <!-- 滑动内容区 -->
</v-touch>
原文地址:https://www.cnblogs.com/szj-/p/12800132.html