1.0.0 • Published 5 years ago

vue-flex-touch v1.0.0

Weekly downloads
6
License
MIT
Repository
-
Last release
5 years ago

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

PropTypedefaultdescription
timeoutnumber500time for long touch. (only mobile)
needSelectbooleanfalseIf it is true, it will select text)
preventDefaultbooleantrueIf it is true, it will stop default event)

reference

License

MIT

Copyright (c) 2019 蓝色的秋风

1.0.0

5 years ago

0.2.0

5 years ago

0.1.6

5 years ago

0.1.5

5 years ago

0.1.4

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago