Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fudiwei/wepy2-com-loading
A component for displaying a blocked loading animation based on wepy.js 2.x. 基于 WePY2 的模态加载对话框组件。
https://github.com/fudiwei/wepy2-com-loading
wechat-miniprogram wepy wepy-com wepy2
Last synced: 2 months ago
JSON representation
A component for displaying a blocked loading animation based on wepy.js 2.x. 基于 WePY2 的模态加载对话框组件。
- Host: GitHub
- URL: https://github.com/fudiwei/wepy2-com-loading
- Owner: fudiwei
- License: mit
- Archived: true
- Created: 2019-11-02T13:47:01.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2021-07-30T03:22:31.000Z (over 3 years ago)
- Last Synced: 2024-09-12T02:09:22.811Z (4 months ago)
- Topics: wechat-miniprogram, wepy, wepy-com, wepy2
- Homepage:
- Size: 6.84 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-wepy - wepy2-com-loading:基于wepy2的Loading组件
README
# wepy2-com-loading
一个阻塞页面的加载动画组件。
此组件依赖 [wepy](https://github.com/Tencent/wepy) 2.0.0+。
如果你正在使用 wepy 1.x,请移步 [wepy-com-loading](https://github.com/fudiwei/wepy-com-loading)。
---
## 用法
安装:
``` shell
npm install @skit/wepy2-com-loading --save
```导入:
``` html
{
usingComponents: {
'ui-loading': 'module:@skit/wepy2-com-loading'
}
}import Wepy from 'wepy';
Wepy.page({
onShow() {
this.$refs['ui-loading'].show('loading ...');
}
});```
> 注意:当前版本的 wepy-cli 存在 Bug,无法打包通过 `node_modules` 引入的 wpy 组件,解决方案请参考 [Issue#2554](https://github.com/Tencent/wepy/issues/2554)。
### 可配置项
#### 属性:
*无*
#### 方法:
``` javascript
/**
* 显示加载对话框。
* @param {Object} options 配置项。
* @param {String} options.content 提示文本。
*/
this.$refs['ui-loading'].show({
content: '加载中'
});/**
* 显示加载对话框。
* @param {String} content 提示文本。
*/
this.$refs['ui-loading'].show('加载中');/**
* 隐藏加载对话框。
*/
this.$refs['ui-loading'].hide();
```