Astra GateEnglish

Form

v2 插件界面组件 Form(输入与表单)的属性、子节点与示例

分组:输入与表单 · 子节点:任意多个子节点

属性

属性类型
onSubmit动作
dirtyBar布尔
layoutvertical · horizontal

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

示例

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

代码json
{
  "type": "Form",
  "props": {
    "onSubmit": "save",
    "dirtyBar": true
  },
  "children": [
    {
      "type": "Field",
      "props": {
        "label": "Endpoint",
        "hint": "An https address",
        "required": true
      },
      "children": [
        {
          "type": "TextField",
          "props": {
            "name": "endpoint",
            "value": "https://api.acme.example"
          }
        }
      ]
    },
    {
      "type": "Button",
      "props": {
        "label": "Save",
        "variant": "primary",
        "submit": true
      }
    }
  ]
}