Toast 通知
展示临时通知,支持语义类型区分消息性质。
使用提示
- 适合:保存成功、操作错误、状态变更通知。
- 不适合:需要用户响应或长时间停留的消息(应放进页面内表单或 callout)。
- 关联组件:callout 用于页面内提示块,badge 用于紧凑状态。
- 需要自动消失时设置 duration;否则它作为页面内通知卡展示。
- type 只表达语义消息性质。
type 变体
namespace: "doc_toast_type_diff",
layout: {
"column:types": {
"toast:info": {
type: "info",
title: "信息",
description: "A new update is available."
},
"toast:success": {
type: "success",
title: "成功",
description: "操作已完成。"
},
"toast:warning": {
type: "warning",
title: "警告",
description: "继续前请复核。"
},
"toast:danger": {
type: "danger",
title: "错误",
description: "出现错误。"
}
}
}
}