1.2.10 • Published 5 years ago
@ubrorg/toast v1.2.10
toast
toast
使用
在页面的 page.json 中配置:
{
"usingComponents": {
"toast": "@ubrorg/toast/lib/index"
}
}在页面的 page.axml 中直接使用:
<toast />在页面的 page.js 中使用:
import { showToast, hideToast } from '@ubrorg/toast/lib/toast';
Page({
onReady() {
showToast({ title: '标题' });
setTimeout(() => {
hideToast(); // 提前隐藏 toast
}, 1000);
}
});option参数
| 属性 | 是否必传 | 默认值 | 解释 |
|---|---|---|---|
title | N | '' | 标题 |
content | N | '' | 内容文案 |
icon | N | '' | icon链接 |
duration | N | 2000 | 多少毫秒之后消失,若为0则不自动消失,需要手动调用 hideToast() 关闭 |
开发
更多命令
miapp newbranch: 新建分支miapp push: 提交代码miapp prepub: 预发(发布 beta 版本)miapp publish: 正式发布