mirror of
https://github.com/WeBankFinTech/fes.js.git
synced 2025-04-06 03:59:53 +08:00
4.2 KiB
4.2 KiB
pageClass |
---|
comp-page-class |
Toast 全局提示
概述
轻量级的信息反馈组件,在屏幕中间显示,并自动消失。
代码示例
显示普通的提示最基本的提示,默认在3秒后消失。
显示错误的提示 显示警告的提示 显示成功的提示不同的提示状态:成功、警告、错误。
10s显示设置配置对象中的duration,可以修改显示时间
在头部提示设置配置对象中的align为top,默认是center
提示关闭回调设置配置对象中的onClose,当toast关闭时执行onClose
API
提供了静态方法,在Vue实例里面调用以下方法来使用组件
this.$Toast(message, [option])
this.$Toast.success(message, [option])
this.$Toast.error(message, [option])
this.$Toast.warn(message, [option])
立即销毁提示:
const destroy = this.$Toast(message, [option]);
destroy()
Options
属性 | 说明 | 类型 | 默认值 |
---|---|---|---|
message | 提示内容 | String | null |
option.duration | 提示显示时间 | Number | 3000 |
option.align | 提示的区域,可选值有top ,center |
String | center |
option.onClose | 当提示消失时触发的事件 | Function | null |