Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions docs/developer-guide/form-schema.md
Original file line number Diff line number Diff line change
Expand Up @@ -761,3 +761,33 @@ UI 效果:
```

:::

### switch

开关组件,提供两个值之间的选择;当您想使用户切换功能开或关时,这是一个很好的选项

参数

- `onValue`:开关打开时的值,默认为 `true`
- `offValue`:开关关闭时的值,默认为 `false`
- `disabled`:是否禁用开关,默认为 `false`

#### 示例

```yaml
- $formkit: switch
name: enabled
label: 是否启用
value: false
```

如果需要开关的值为其他值,可以设置 `onValue` 和 `offValue` 参数。

```yaml
- $formkit: switch
name: enabled
label: 是否启用
value: "active"
onValue: "active"
offValue: "inactive"
```
6 changes: 6 additions & 0 deletions docs/developer-guide/plugin/api-changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ spec:

尝试构建并解决编译错误即可。

## 2.22.2

### 表单定义 > 新增 `switch` 组件

在 2.22.2 中,我们为 FormKit 表单新增了 `switch` 组件,用于定义一个功能的开关,详细文档可查阅:[表单定义#switch](../../developer-guide/form-schema.md#switch)

## 2.22.0

### `@halo-dev/console-shared` 改名
Expand Down
6 changes: 6 additions & 0 deletions docs/developer-guide/theme/api-changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ title: API 变更日志
description: 记录每一个版本的主题 API 变更记录,方便开发者适配
---

## 2.22.2

### 表单定义 > 新增 `switch` 表单类型

在 2.22.2 中,我们为 FormKit 表单新增了 `switch` 组件,用于定义一个功能的开关,详细文档可查阅:[表单定义#switch](../../developer-guide/form-schema.md#switch)

## 2.22.0

### 表单定义 > 新增 Iconify 图标选择器
Expand Down
30 changes: 30 additions & 0 deletions versioned_docs/version-2.22/developer-guide/form-schema.md
Original file line number Diff line number Diff line change
Expand Up @@ -761,3 +761,33 @@ UI 效果:
```

:::

### switch

开关组件,提供两个值之间的选择;当您想使用户切换功能开或关时,这是一个很好的选项

参数

- `onValue`:开关打开时的值,默认为 `true`
- `offValue`:开关关闭时的值,默认为 `false`
- `disabled`:是否禁用开关,默认为 `false`

#### 示例

```yaml
- $formkit: switch
name: enabled
label: 是否启用
value: false
```

如果需要开关的值为其他值,可以设置 `onValue` 和 `offValue` 参数。

```yaml
- $formkit: switch
name: enabled
label: 是否启用
value: "active"
onValue: "active"
offValue: "inactive"
```
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ spec:

尝试构建并解决编译错误即可。

## 2.22.2

### 表单定义 > 新增 `switch` 组件

在 2.22.2 中,我们为 FormKit 表单新增了 `switch` 组件,用于定义一个功能的开关,详细文档可查阅:[表单定义#switch](../../developer-guide/form-schema.md#switch)

## 2.22.0

### `@halo-dev/console-shared` 改名
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ title: API 变更日志
description: 记录每一个版本的主题 API 变更记录,方便开发者适配
---

## 2.22.2

### 表单定义 > 新增 `switch` 表单类型

在 2.22.2 中,我们为 FormKit 表单新增了 `switch` 组件,用于定义一个功能的开关,详细文档可查阅:[表单定义#switch](../../developer-guide/form-schema.md#switch)

## 2.22.0

### 表单定义 > 新增 Iconify 图标选择器
Expand Down