1.0.2 • Published 4 years ago

vue-motions v1.0.2

Weekly downloads
3
License
ISC
Repository
-
Last release
4 years ago

vue-motions

Vue 轻量级手势方向指令。

安装

使用 npm 安装:

npm i vue-motions --save
import Vue from 'vue'
import motion from 'vue-motions'

Vue.use(motion)

使用

<template>
    <div class="motion" v-motion="motion"></div>
</template>
new Vue({
  methods: {
      motion: function (e) {        
          if(e==='Swipe-right'){
              console.log('右划')
          }
          if(e==='Swipe-left'){
              console.log('左划');
          }
      }
  }
})