Vue-touch的使用
生活随笔
收集整理的這篇文章主要介紹了
Vue-touch的使用
小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
#####有時(shí)候我們不止需要有返回鍵,也要有手勢(shì)滑動(dòng)切換頁(yè)面的功能時(shí),這個(gè)時(shí)候vue-touch就派上用場(chǎng)了
#####API地址:
#####安裝
npm install vue-touch@next --save //main.js中引入: import VueTouch from 'vue-touch' Vue.use(VueTouch, {name: 'v-touch'})#####用法如下:
//html代碼 <template><v-touch v-on:swipeleft="swiperleft" v-on:swiperight="swiperright" class="wrapper"><div class="menu-container" ref="menuContainer"> <!-- 這個(gè)是內(nèi)容 --> </div></v-touch> </template> export default {name: 'Queue',data () {return {}},methods: {swiperleft: function () {this.$router.push({'path':'/queuehistory'});},swiperright: function () {this.$router.push({'path':'/home'});}}}總結(jié)
以上是生活随笔為你收集整理的Vue-touch的使用的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 重温前端基础(二) 移动WEB开发
- 下一篇: 前端知识点随记