0.0.22 • Published 3 years ago

@retailwe/ui-toast v0.0.22

Weekly downloads
-
License
-
Repository
-
Last release
3 years ago

toast 轻提示

引入

全局引入,在 miniprogram 根目录下的app.json中配置,局部引入,在需要引入的页面或组件的index.json中配置。

// app.json 或 index.json
"usingComponents": {
  "wr-toast": "@retailwe/ui-toast/index"
}

代码演示

基础用法

通用 toast 一些信息文字提示

<button bindtap="handleTap">出来吧,toast!!</button> <wr-toast id="wr-toast" />
Page({
  data: {},
  handleTap(e) {
    const { index } = e.currentTarget.dataset;
    const toast = this.selectComponent(`#wr-toast`);
    toast.show({
      icon: 'success',
      text: 'toast内容'
      zIndex: 100,
      duration: 2000,
    });
  },
});

使用 core/toast.ts

通用 toast 一些信息文字提示

<button bindtap="handleTap">出来吧,toast!!</button> <wr-toast id="wr-toast" />
import Toast from '你的路径/core/base/helpers/toast';
Page({
  data: {},
  handleTap(e) {
    Toast({
      context: this,
      selector: '#wr-toast',
      text: 'toast内容',
    });
  },
});

API

wr-toast Props

参数说明类型默认值版本
icon弹窗显示 icon 类型名称stringsuccess-
iconColor弹窗显示 icon 颜色string#fff-
iconSize弹窗显示 icon 大小string--
text弹窗显示文字提示string--
textColor弹窗显示文字颜色string | -
zIndex当前弹窗所在的层级值number10-
fontSize弹窗显示文字大小number--
duration弹窗显示毫秒数number2000-
0.0.22

3 years ago

0.0.21

3 years ago

0.0.20

4 years ago

0.0.19

4 years ago

0.0.18

4 years ago

0.0.17

4 years ago

0.0.16

4 years ago

0.0.15

4 years ago

0.0.14

4 years ago

0.0.13

4 years ago

0.0.12

4 years ago

0.0.11

4 years ago

0.0.10

4 years ago

0.0.9

4 years ago

0.0.8

4 years ago

0.0.7-beta.1

4 years ago