• linkedu视频
  • 平面设计
  • 电脑入门
  • 操作系统
  • 办公应用
  • 电脑硬件
  • 动画设计
  • 3D设计
  • 网页设计
  • CAD设计
  • 影音处理
  • 数据库
  • 程序设计
  • 认证考试
  • 信息管理
  • 信息安全
菜单
linkedu.com专业计算机教程网站
  • 网页制作
  • 数据库
  • 程序设计
  • 操作系统
  • CMS教程
  • 游戏攻略
  • 脚本语言
  • 平面设计
  • 软件教程
  • 网络安全
  • 电脑知识
  • 服务器
  • 视频教程
  • html/xhtml
  • html5
  • CSS
  • XML/XSLT
  • Dreamweaver教程
  • Frontpage教程
  • 心得技巧
  • bootstrap
  • vue
  • AngularJS
  • HBuilder教程
  • css3
  • 浏览器兼容
  • div/css
  • 网页编辑器
  • axure
您的位置:首页 > 网页设计 >vue > vue-gesture 使用

vue-gesture 使用

作者:vue-gesture 字体:[增加 减小] 来源:互联网 时间:2018-11-20

本文主要包含vue-gesture 使用,vue-gesture文档等相关知识,vue-gesture希望在学习及工作中可以帮助到您

vue-gesture

gesture events plugin for Vue.js 2. You can v-gesture directive,and directive auguments can use a tap, swipe, touchstart etc.When you are in the use of the PC,"tap, longtap, touchstart" Will automatically be converted to "click".

  • tap — fires when the element is tapped.
  • doubleTap — this pair of events can be used to detect double taps on the same element
  • longTap — fires when an element is tapped and the finger is held down for more than 750ms.
  • swipe, swipeLeft, swipeRight, swipeUp, swipeDown — fires when an element is swiped
  • touchstart touchmove touchend click- These equivalent to touch the primary event

Install

CommonJS

  • Available through npm as vue-gesture.

    
     
    var VueGesture = require('vue-gesture')
    Vue.use(VueGesture)

Direct include

  • You can also directly include it with a <script> tag when you have Vue already included globally. It will automatically install itself, and will add a global vueGesture.

Usage

Using the v-gesture directive


 
<vue-gesture :type="'touchstart'"  :call="handleComponent.bind(this,'touchstart')" >touchstart</vue-gesture>
  <vue-gesture :type="'touchmove'"  :call="handleComponent.bind(this,'touchmove')" ><i>touchmove</i></vue-gesture>
  <vue-gesture :type="'touchend'"  :call="handleComponent.bind(this,'touchend')" >touchend</vue-gesture>
  <vue-gesture :type="'tab'"  :call="handleComponent.bind(this,'tab')" >tap</vue-gesture>
  <vue-gesture :type="'doubletap'"  :call="handleComponent.bind(this,'doubletap')">doubleTap</vue-gesture>
  <vue-gesture :type="'longTap'"  :call="handleComponent.bind(this,'longTap')">longTap</vue-gesture>
  <vue-gesture :type="'swipe'"  :call="handleComponent.bind(this,'swipe')">swipe</vue-gesture>
  <vue-gesture :type="'swipeLeft'"  :call="handleComponent.bind(this,'swipeLeft')">swipeLeft</vue-gesture>
  <vue-gesture :type="'swipeRight'"  :call="handleComponent.bind(this,'swipeRight')">swipeRight</vue-gesture>
  <vue-gesture :type="'swipeUp'"  :call="handleComponent.bind(this,'swipeUp')">swipeUp</vue-gesture>
  <vue-gesture :type="'swipeDown'"  :call="handleComponent.bind(this,'swipeDown')">swipeDown</vue-gesture>
  <vue-gesture :type="'click'"  :call="handleComponent.bind(this,'click')">click</vue-gesture>
 

Configuring Recognizer Options

There are two ways to customize recognizer options such as direction and threshold. The first one is setting global options:


 
// change the config
vueGesture.config = {
  maxSingleTapTimeInterval: 200
}

Registering Custom Events

See /example for a multi-event demo. To build it, run npm install && npm run build.

您可能想查找下面的文章:

  • vue-gesture 使用

相关文章

  • 2017-05-30Vue.js实现模拟微信朋友圈开发demo
  • 2017-05-30vue.js表格分页示例
  • 2017-05-30Vue.js系列之vue-router(上)(3)
  • 2017-05-30vue.js指令v-for使用及索引获取
  • 2017-05-30vue实现简单实时汇率计算功能
  • 2017-09-10vueJs2.0组件
  • 2017-05-30超简单的Vue.js环境搭建教程
  • 2017-05-30Vue实现购物车功能
  • 2017-05-30利用vue-router实现二级菜单内容转换
  • 2017-05-30vue构建单页面应用实战

文章分类

  • html/xhtml
  • html5
  • CSS
  • XML/XSLT
  • Dreamweaver教程
  • Frontpage教程
  • 心得技巧
  • bootstrap
  • vue
  • AngularJS
  • HBuilder教程
  • css3
  • 浏览器兼容
  • div/css
  • 网页编辑器
  • axure

最近更新的内容

    • 浅析vue component 组件使用
    • Vue结合原生js实现自定义组件自动生成示例
    • vue-hook-form使用详解
    • Vue2递归组件实现树形菜单
    • Vue.js每天必学之表单控件绑定
    • vue2的todolist入门小项目的详细解析
    • 详解VueJs异步动态加载块
    • vuejs2.0运用原生js实现简单的拖拽元素功能示例
    • Vue.js如何优雅的进行form validation
    • 基于Vue的文字跑马灯组件(npm 组件包)

关于我们 - 联系我们 - 免责声明 - 网站地图

©2020-2025 All Rights Reserved. linkedu.com 版权所有