Skip to content

Commit 12977c8

Browse files
committed
docs: update alert and apiComponent docs
1 parent 3fb4fba commit 12977c8

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

docs/src/components/common-ui/vben-alert.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,11 @@ Alert提供的快捷方法alert、confirm、prompt动态创建的弹窗在已打
4242

4343
当弹窗的content、footer、icon使用自定义组件时,在这些组件中可以使用 `useAlertContext` 获取当前弹窗的上下文对象,用来主动控制弹窗。
4444

45-
::: tip 注意 `useAlertContext`只能用在setup或者函数式组件中。:::
45+
::: tip 注意
46+
47+
`useAlertContext`只能用在setup或者函数式组件中。
48+
49+
:::
4650

4751
### Methods
4852

docs/src/components/common-ui/vben-api-component.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -151,17 +151,17 @@ function fetchApi(): Promise<Record<string, any>> {
151151
| options | 直接传入选项数据,也作为api返回空数据时的后备数据 | `OptionsItem[]` | - | - |
152152
| visibleEvent | 触发重新请求数据的事件名 | `string` | - | - |
153153
| loadingSlot | 目标组件的插槽名称,用来显示一个"加载中"的图标 | `string` | - | - |
154-
| autoSelect | 自动设置选项 | `'first' \| 'last' \| 'one'\| (item: OptionsItem[]) => OptionsItem \| false` | `false` | >5.5.4 |
154+
| autoSelect | 自动设置选项 | `'first' \| 'last' \| 'one'\| ((item: OptionsItem[]) => OptionsItem) \| false` | `false` | >5.5.4 |
155155

156156
#### autoSelect 自动设置选项
157157

158158
如果当前值为undefined,在选项数据成功加载之后,自动从备选项中选择一个作为当前值。默认值为`false`,即不自动选择选项。注意:该属性不应用于多选组件。可选值有:
159159

160-
- `first`:自动选择第一个选项
161-
- `last`:自动选择最后一个选项
162-
- `one`:有且仅有一个选项时,自动选择它
163-
- `函数`:自定义选择逻辑,函数的参数为options,返回值为选择的选项
164-
- false:不自动选择选项
160+
- `"first"`:自动选择第一个选项
161+
- `"last"`:自动选择最后一个选项
162+
- `"one"`:有且仅有一个选项时,自动选择它
163+
- `自定义函数`:自定义选择逻辑,函数的参数为options,返回值为选择的选项
164+
- `false`:不自动选择选项
165165

166166
### Methods
167167

0 commit comments

Comments
 (0)