Astra GateEnglish

Page

v2 插件界面组件 Page(布局)的属性、子节点与示例

分组:布局 · 子节点:任意多个子节点

属性

属性类型
title文本
subtitle文本
iconicon 令牌
actions节点数组
tabsJSON
backJSON
widthnarrow · default · wide · full

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

示例

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

代码json
{
  "type": "Page",
  "props": {
    "title": "Word guard",
    "subtitle": "acme.word-guard",
    "icon": "shield",
    "actions": [
      {
        "type": "Button",
        "props": {
          "label": "Add word",
          "variant": "primary",
          "onPress": "add"
        }
      }
    ]
  },
  "children": [
    {
      "type": "Text",
      "props": {
        "value": "Page body"
      }
    }
  ]
}