toast(content, options)
toast 一般用于操作成功时的提示场景
Kind: global function
| Param | Type | Default | Description |
|---|---|---|---|
| content | string | toast的文字 | |
| options | Object | function | 配置项或回调 | |
| [options.duration] | number | 3000 | 多少毫秒后关闭toast |
| [options.callback] | function | 关闭后的回调 | |
| [options.className] | string | 自定义类名 |
Example
weui.toast('操作成功', 3000);
weui.toast('操作成功', {
duration: 3000,
className: 'custom-classname',
callback: function(){ console.log('close') }
});