vue-flex-touch

vue-flex-touch both for long press touch on mobile and right click on pc
880
Install
npm install vue-flex-touch
Latest Version:1.0.0
Vue:2
License:MIT
Last Updated:May 19, 2019
Links: npm
Maintainer: hua1995116

vue-flex-touch

A for Vue.js directive both for long press touch on mobile and right click on pc

demo

https://n0v3orw484.codesandbox.io/

Install

npm install vue-flex-touch

Usage


// main
import flexTouch from 'vue-flex-touch'

Vue.use(flexTouch, { timeout: 900 });

// component
<div id="app" v-flex-touch="handleTouch">
  <h1>I'm flex touch demo</h1>
  {{flex}}
</div>


data() {
  return {
    flex: false
  };
},
methods: {
  handleTouch() {
    this.flex = !this.flex;
  }
}

examle

base use

Edit Vue Template

used in chat '@'

Edit Vue Template

config

Prop Type default description
timeout number 500 time for long touch. (only mobile)
needSelect boolean false If it is true, it will select text)
preventDefault boolean true If it is true, it will stop default event)

reference

License

MIT

Copyright (c) 2019 蓝色的秋风

Related Packages

vue3-hand-mobile

Vue mobile gesture action event.

5,464
vue-directive-touch

Touch directive of vue 2.0

8,486 72
@xk-team/xk-plugin

适配Vue2/Vue3

1,021 1
vue-scrollbar-live

A vue scrollbar component, support SSR.

32,986 11
sun-card-design

Vue3 卡片设计组件库,支持 PC 和移动端预览

5,198

Version History

Version Released Vue License
1.0.0 ^2.6.10 MIT
0.2.0 ^2.6.10 MIT
0.1.6 ^2.6.10 MIT
0.1.5 ^2.6.10 MIT
0.1.4 MIT