vue-插件总结

10次阅读

共计 474 个字符,预计需要花费 2 分钟才能阅读完成。

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'});
    }
  }

}

正文完
 0