方法一、v-touch 官网地址
包括单击、双击、长按、缩放等手势事件
安装
npm install vue-touch@next --save
引入
main.js中引入:
import VueTouch from 'vue-touch'
Vue.use(VueTouch, {name: 'v-touch'})
使用
html代码
js代码
export default {
name: 'Queue',
data () {
return {
}
},
methods: {
swiperleft: function () {
this.$router.push({'path':'/queuehistory'});
},
swiperright: function () {
this.$router.push({'path':'/home'});
}
}
}
发现BUG:vue-touch不能上下滑动的问题
在v-touch标签里添加class
.v-touch{touch-action:pan-y !important;
}
参考:https://www.cnblogs.com/ichenchao/p/11697856.html
方法二:AlloyFinger (腾讯的) 官网地址<