# This plugin is deprecated and not maintained anymore.
## vue-touch
> Touch events plugin for Vue.js. **This plugin does not support Vue 2.0 yet.**
This is a directive wrapper for Hammer.js 2.0.
## Install
> This branch is only compatible with Vue 1.0. For the Vue 2.0 compatible rewrite, see the `next` branch
#### CommonJS
- Available through npm as `vue-touch`.
``` js
var VueTouch = require('vue-touch')
Vue.use(VueTouch)
```
#### Direct include
- You can also directly include it with a `<script>` tag when you have Vue and Hammer.js already included globally. It will automatically install itself, and will add a global `VueTouch`.
## Usage
#### Using the `v-touch` directive
``` html
<a v-touch:tap="onTap">Tap me!</a>
<div v-touch:swipeleft="onSwipeLeft">Swipe me!</div>
```
#### Configuring Recognizer Options
There are two ways to customize recognizer options such as `direction` and `threshold`. The first one is setting global options:
``` js
// change the threshold for all swipe recognizers
VueTouch.config.swipe = {
threshold: 200
}
```
Or, you can use the `v-touch-options` directive to configure the behavior on a specific element:
``` html
<!-- detect only horizontal pans with a threshold of 100 -->
<a
v-touch:pan="onPan"
v-touch-options:pan="{ direction: 'horizontal', threshold: 100 }">
</a>
```
#### Registering Custom Events
``` js
// example registering a custom doubletap event.
// the `type` indicates the base recognizer to use from Hammer
// all other options are Hammer recognizer options.
VueTouch.registerCustomEvent('doubletap', {
type: 'tap',
taps: 2
})
```
``` html
<a v-touch:doubletap="onDoubleTap"></a>
```
See [Hammer.js documentation](http://hammerjs.github.io/getting-started/) for all available events.
See `/example` for a multi-event demo. To build it, run `npm install && npm run build`.
## License
[MIT](http://opensource.org/licenses/MIT)
赵闪闪168
- 粉丝: 1727
- 资源: 6942
最新资源
- 基于Matlab实现克里金插值(源码+数据).rar
- Java毕业设计-springboot-vue-在线英语阅读分级平台(源码+sql脚本+29页零基础部署图文详解+31页论文+环境工具+教程+视频+模板).zip
- Java毕业设计-springboot-vue-员工健康管理系统(源码+sql脚本+29页零基础部署图文详解+32页论文+环境工具+教程+视频+模板).zip
- Java毕业设计-springboot-vue-预报名管理系统(源码+sql脚本+29页零基础部署图文详解+32页论文+环境工具+教程+视频+模板).zip
- Cursor中文使用手册PDF
- 全网独家MATLAB图像空间滤波研究:加权均值与中值滤波实战解析(含椒盐与高斯噪声处理)+原理详解+实验分析+高清流程图,全网最详细功能最完整的MATLAB图像空间滤波研究:加权均值和中值滤波(加入椒
- 测试 cursor-test-cursor-main.zip
- Java毕业设计-springboot-vue-智慧草莓基地管理系统(源码+sql脚本+29页零基础部署图文详解+36页论文+环境工具+教程+视频+模板).zip
- Java毕业设计-springboot-vue-在线装修管理系统(源码+sql脚本+29页零基础部署图文详解+31页论文+环境工具+教程+视频+模板).zip
- Java毕业设计-springboot-vue-招生宣传管理系统(源码+sql脚本+29页零基础部署图文详解+35页论文+环境工具+教程+视频+模板).zip
- "算术优化算法(AOA-2021)在微电网混合储能容量配置中的比较研究:经济性、可靠性与负荷失电率分析",算术优化算法(AOA-2021新算法)新算法混合储能容量配置 (完全复现lunwen)关于微电
- Java毕业设计-springboot-vue-中小型制造企业质量管理系统(源码+sql脚本+29页零基础部署图文详解+37页论文+环境工具+教程+视频+模板).zip
- 刷新CURSOR的UUIDcursor-uuid-master.zip
- Java毕业设计-springboot-vue-助农管理系统(源码+sql脚本+29页零基础部署图文详解+22页论文+环境工具+教程+视频+模板).zip
- Java毕业设计-springboot-vue-智慧社区居家养老健康管理系统(源码+sql脚本+29页零基础部署图文详解+31页论文+环境工具+教程+视频+模板).zip
- 基于LSTM时间序列预测的Matlab长短期记忆网络回归模型:轻松替换数据集文件实现预测,基于LSTM时间序列预测,matlab长短期记忆网络回归预测 替输入数据集文件即可 ,核心关键词:LSTM
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈