2.0.1 • Published 6 years ago

loki-assassin-toast v2.0.1

Weekly downloads
-
License
ISC
Repository
-
Last release
6 years ago

toast

稳定版本

1.0.1 依赖vue 2.0.0 不依赖vue 仅提供traceId, info, duration字段使用不支持icon

安装

npm install @souche/assassin-toast

//引入
import Toast from '@souche/assassin-toast';

使用

text toast

//持续时间默认1500ms
Toast.show({info: '这是一个toast'});

Toast.show({'title': 'title', 'info': 'tetstdfsafasdfasfdsfasfdsafdsfafadfsdafafdsfasdfsdfasfsad', duration: 3000});

text toast

long text toast

带traceId二维码的toast

//注意: traceId一般长度为6位,为保持能正常扫码,若traceId超出6位,请让后端修改
Toast.show({'info': 'tetst','traceId': 'wefedf'});

traceIdQr toast

带icon的toast

//图片自行传入
Toast.show({'icon':'https://git.souche-inc.com/uploads/-/system/project/avatar/2380/logo.png','info': 'hello'});

//默认的success toast 
Toast.show({'type': 'success','info': 'hello'});

//默认的fail toast 
Toast.show({'type': 'fail','info': 'hello'});

icon toast success toast fail toast