0.0.17 • Published 4 years ago
@retailwe/ui-notify v0.0.17
Notify 消息提示
引入
"usingComponents": {
"wr-notify": "@retailwe/ui-notify/index"
}
代码演示
基础用法
<!-- 在页面内添加对应的节点 -->
<wr-notify id="title1" type="{{type}}" message="{{message}}"> </wr-notify>
通知类型
支持primary
、success
、warning
、danger
四种通知类型,默认为danger
Page({
data: {
duration: 500,
message: '危险notify',
},
handleTap(e) {
const { index } = e.currentTarget.dataset;
const notify = this.selectComponent(`#title${index}`);
notify.show();
},
});
API
方法
方法名 | 说明 | 参数 | 返回值 |
---|
参数
参数 | 说明 | 类型 | 默认值 | - |
---|---|---|---|---|
type | 提示类型 | string | danger | - |
bgColor | 背景颜色 | string | red | - |
message | 展示文案 | string | | - | |
duration | 展示时长(ms),值为 0 时,notify 不会消失 | number | 3000 | - |
textColor | 文案颜色 | string | #fff | - |
fontSize | 文案字体大小 | string | 26rpx | - |