halo/ui/docs
Takagi 5d5df7c7a9
feat: add dynamic list input (#6146)
#### What type of PR is this?

/kind feature
/area ui
/milestone 2.17.x

#### What this PR does / why we need it:

为 formkit 增加动态列表的 input。

使用方式:

```
- $formkit: list
  name: users
  label: Users
  addLabel: Add User
  min: 1
  max: 3
  itemType: string
  children:
    - $formkit: text
      index: "$index"
      validation: required
```

> [!NOTE]
> `list` 组件有且只有一个子节点,并且必须为子节点传递 `index` 属性。若想提供多个字段,则建议使用 `group` 组件包裹。

#### How to test it?

测试动态数组是否正常可用。保存的结果是否为 `{users: ["", ""]}`

#### Which issue(s) this PR fixes:

Fixes #6098

#### Does this PR introduce a user-facing change?
```release-note
为 Formkit 增加动态列表的 input 组件 list
```
2024-06-26 09:48:49 +00:00
..
components Move folder console to ui 2024-02-02 22:22:51 +08:00
custom-formkit-input feat: add dynamic list input (#6146) 2024-06-26 09:48:49 +00:00
extension-points Move folder console to ui 2024-02-02 22:22:51 +08:00
project-structure Move folder console to ui 2024-02-02 22:22:51 +08:00
routes-generation Move folder console to ui 2024-02-02 22:22:51 +08:00