Astra GateEnglish

Alert

v2 插件界面组件 Alert(内容)的属性、子节点与示例

分组:内容 · 子节点:不接受子节点

可以作为 tray.panel 的根节点。

属性

属性类型
toneneutral · accent · success · warning · danger
title文本
message文本
actions节点数组
dismissible布尔
onDismiss动作

另有所有组件都有的通用属性。动作类型的属性写动作名,或 { action, args }。

示例

组件画廊和两端比对用的就是这棵树:

代码json
{
  "type": "Alert",
  "props": {
    "tone": "warning",
    "title": "Words list is empty",
    "message": "Nothing will be checked until you add a word."
  }
}

画廊里另有这些状态:tone-neutral、tone-accent、tone-success、tone-danger。