vue 插件总结
文章目录
Vue-touch的使用
可以进行全面屏下的手势切换
安装
npm install vue-touch@next --save
//main.js中引入:
import VueTouch from 'vue-touch'
Vue.use(VueTouch, {name: 'v-touch'})
使用
<template>
<v-touch v-on:swipeleft="swiperleft" v-on:swiperight="swiperright" class="wrapper">
<div class="menu-container" ref="menuContainer">
</div>
</v-touch>
</template>
export default {
name: 'Queue',
data () {
return {
}
},
methods: {
swiperleft: function () {
this.$router.push({'path':'/about'});
},
swiperright: function () {
this.$router.push({'path':'/home'});
}
}
}
评论
登录后参与技术讨论,分享你的经验与见解。
登录 / 注册暂无评论