https://github.com/chimeejs/chimee-plugin-mobile-state
chimee mobile centerstate
https://github.com/chimeejs/chimee-plugin-mobile-state
Last synced: 2 months ago
JSON representation
chimee mobile centerstate
- Host: GitHub
- URL: https://github.com/chimeejs/chimee-plugin-mobile-state
- Owner: Chimeejs
- Created: 2017-11-22T11:34:34.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-11-07T14:51:09.000Z (over 7 years ago)
- Last Synced: 2025-02-26T22:44:35.788Z (over 1 year ago)
- Language: JavaScript
- Size: 428 KB
- Stars: 1
- Watchers: 7
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# chimee-plugin-mobile-state
## install
安装
```shell
# 依赖于 chimee, 首先需要安装 chimee
npm install chimee
# 安装控制条组件
npm install chimee-plugin-mobile-state
```
使用
```javascript
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: 当前状态