vue-pressure
A Vue.js 2.0 directive for pressure.js
Install
# install vue-pressurenpm install vue-pressure --save# Pressure.js is already in the vue-pressure package, so you can not install Pressure.js anymore.
Use in Vue.js
// add in main.jsVue// or set some configsVue// use pressure.mapthis$pressure// use vue-pressure in elements<img v-pressure @pressureChange="handlePressureChange"/><img v-pressure @pressureStart="handlePressureStart"/><img v-pressure @pressureEnd="handlePressureEnd"/><img v-pressure @pressureDeepStart="handlePressureStartDeepPress"/><img v-pressure @pressureDeepEnd="handlePressureEndDeepPress"/>// or set some options to current element<img v-pressure="{polyfill: true,polyfillSpeedUp: 1000,polyfillSpeedDown: 0,preventSelect: true,only: null}" @pressureChange="handlePressureChange" src="http://somePicUrl.png"/>// in Vue componentss// add .native<Hello-World v-pressure @pressureChangenative="handlePressureChange"></HelloWorld>// function handleChange// field 'force' is inserted into argument event{console}// only 'pressureChange', 'pressureStart', 'pressureDeepStart' have a argument named event
For Details
See demos on: https://pressurejs.com/
Please see APIs on Github of Pressure.js: https://github.com/stuyam/pressure
or its documentation: https://pressurejs.com/documentation.html