vue-flex-touch both for long press touch on mobile and right click on pc
npm install vue-flex-touch> A for Vue.js directive both for long press touch on mobile and right click on pc
https://n0v3orw484.codesandbox.io/
shell
npm install vue-flex-touch
`Usage
`javascript// main
import flexTouch from 'vue-flex-touch'
Vue.use(flexTouch, { timeout: 900 });
// component
I'm flex touch demo
{{flex}}
data() {
return {
flex: false
};
},
methods: {
handleTouch() {
this.flex = !this.flex;
}
}
``



| 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) |
MIT
Copyright (c) 2019 蓝色的秋风