Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wepyjs/wepy-com-toast
微信小程序toast组件
https://github.com/wepyjs/wepy-com-toast
wepy
Last synced: about 2 months ago
JSON representation
微信小程序toast组件
- Host: GitHub
- URL: https://github.com/wepyjs/wepy-com-toast
- Owner: wepyjs
- Created: 2016-12-14T10:48:07.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2017-04-13T08:30:49.000Z (over 7 years ago)
- Last Synced: 2024-07-27T14:33:27.409Z (6 months ago)
- Topics: wepy
- Language: JavaScript
- Size: 3.91 KB
- Stars: 106
- Watchers: 6
- Forks: 29
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-wepy - wepy-com-toast:微信小程序toast组件
README
# 微信小程序 wepyjs 第三方toast组件
![toast](https://cloud.githubusercontent.com/assets/2182004/21178902/8f98f056-c22c-11e6-90ee-a9afa73399b9.jpg)
## 说明
官方toast组件只支持显示`success`,`loading`两种icon,因此需要一个更加个性化的toast组件。
此组件依赖于[wepyjs v1.1.9+](https://github.com/wepyjs/wepy),如果没有使用`wepyjs`,则可以使用[原版toast组件](https://github.com/kiinlam/wetoast)。## 使用
### 安装组件
```
npm install wepy-com-toast --save
```### 引入组件
```javascript
// index.wpy
import wepy from 'wepy';
import Toast from 'wepy-com-toast';export default class Index extends wepy.page {
components = {
toast: Toast
};
}```
### 调用方法
```javascript
let promise = this.$invoke('toast', 'show', {
title: '自定义标题',
img: 'https://raw.githubusercontent.com/kiinlam/wetoast/master/images/star.png',
});promise.then((d) => {
console.log('toast done');
});
```## 更多说明
参考[原版插件](https://github.com/kiinlam/wetoast)。