# Toast 全局提示
# 概述
轻量级的信息反馈组件,在屏幕中间显示,并自动消失。
# 代码示例
# 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 |