Toast 提示

全局反馈用户操作的结果。

基础用法

可以使用 type 属性,指定 Toast 的类型。


show code

延时关闭

duration 属性设置自动关闭的时长。

show code

API

属性 Attribute

AttributeTypeDefaultDescription
showbooleanfalse是否展示
type'info' | 'success' | 'warning' | 'error'info提示的类型
durationnumber3000持续时长(毫秒)

插槽 Slot

SlotDescription
default默认插槽

事件 Event

EventTypeDescription
update:show(state: boolean) => void监听 show 值变化