Skip to content

Chimeejs/chimee-plugin-gesture

Folders and files

NameName
Last commit message
Last commit date

Latest commit

author
yandeqiang
Nov 19, 2018
c63d7d5 · Nov 19, 2018

History

12 Commits
Nov 17, 2017
Dec 9, 2017
Nov 19, 2018
Oct 22, 2018
Nov 17, 2017
Dec 9, 2017
Oct 22, 2018
Nov 19, 2018

Repository files navigation

chimee-plugin-gesture

该插件是一个基础插件,移动端的插件可以继承它,为这些插件提供手势事件,暴露给上层插件使用

install

安装

# 依赖于 chimee, 首先需要安装 chimee
npm install chimee
# 安装手势组件
npm install chimee-plugin-gesture

使用

import chimee from 'chimee';
import gestureFactory from 'chimee-plugin-gesture';

// 安装插件
const mobiControlbar = gestureFactory({

  // 参考 chimee 插件配置
  name: 'mobiControlbar',
  // ...
  // 直接使用 ['tap', 'swipe', 'panstart', 'panmove', 'panend', 'press', 'doubletap'], 这些事件就好了,不需要使用 touch 事件
  events: {
    tap() {

    },
    d_tap() {

    }
  }
})
chimee.install(mobiControlbar);
const player = new chimee({
  // ...
  // 使用插件
  plugin: [
    mobiControlbar.name // 或者 'mobiControlbar'
  ]
});

配置

chimee 配置 events 不用再监听 touchstart/ touchmove/touchend 只需要监听操作 'tap', 'swipe', 'panstart', 'panmove', 'panend', 'press', 'doubletap' 就好了 支持前缀 'w_'(wrap dom), 'c_'(container dom), 'd_'(插件自身 dom), 不加前缀 videoElement 具体可以参考 chimee plugin 配置

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published