chimee-plugin-mobile-state

0.0.20 • Public • Published

chimee-plugin-mobile-state

install

安装

# 依赖于 chimee, 首先需要安装 chimee 
npm install chimee
# 安装控制条组件 
npm install chimee-plugin-mobile-state

使用

import chimee from 'chimee';
import chimeePluginMobileState from 'chimee-plugin-mobile-state';
 
// 安装插件
chimee.install(chimeePluginMobileState);
const player = new chimee({
  // ...
  // 使用插件
  plugin: [
    {
      chimeePluginMobileState.name,
      errorTips: '错误提示', // 也可以塞一个 dom 节点
      icon: {
        loading: ``, // 可传入 svg, 内部 innerHTML
        play: `` // svg
      },
      expectTime: 3e4 // 最长加载时间
    }
  ]
});

也可以在页面中引用 /lib/index.browser.js 然后在页面中使用 chimeePluginMobileState

包含状态

  • 开始
  • loading
  • error

包含手势

  • panstart
  • panmove
  • panend

事件

state-panstart

  • 含义: 在这个插件上触发 panstart 手势
  • 回调参数:
    • evt: touch 对象

state-panmove

  • 含义: 在这个插件上触发 panmove 手势
  • 回调参数:
    • evt: touch 对象

state-panend

  • 含义: 在这个插件上触发 panstend 手势
  • 回调参数:
    • evt: touch 对象

state-tap

  • 含义: 在这个插件上触发 tap 手势
    • 回调参数:
      • evt: touch 对象

state-change

  • 含义: 这个插件状态发生变化
  • 回调参数:
    • state: 当前状态

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.0.20
    2
    • latest

Version History

Package Sidebar

Install

npm i chimee-plugin-mobile-state

Weekly Downloads

14

Version

0.0.20

License

ISC

Unpacked Size

304 kB

Total Files

32

Last publish

Collaborators

  • gaoyiyi
  • huzunjie
  • songguangyu
  • toxicjohann
  • welefen
  • yandeqiang