Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
monorepo
/
venus
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
1
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit d18f5617
authored
Apr 15, 2025
by
Netfan
Committed by
GitHub
Apr 15, 2025
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
docs: update alert and apiComponent docs (#5961)
1 parent
333998b5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
7 deletions
docs/src/components/common-ui/vben-alert.md
docs/src/components/common-ui/vben-api-component.md
docs/src/components/common-ui/vben-alert.md
View file @
d18f561
...
...
@@ -42,7 +42,11 @@ Alert提供的快捷方法alert、confirm、prompt动态创建的弹窗在已打
当弹窗的content、footer、icon使用自定义组件时,在这些组件中可以使用
`useAlertContext`
获取当前弹窗的上下文对象,用来主动控制弹窗。
::: tip 注意
`useAlertContext`
只能用在setup或者函数式组件中。:::
::: tip 注意
`useAlertContext`
只能用在setup或者函数式组件中。
:::
### Methods
...
...
docs/src/components/common-ui/vben-api-component.md
View file @
d18f561
...
...
@@ -151,17 +151,17 @@ function fetchApi(): Promise<Record<string, any>> {
| options | 直接传入选项数据,也作为api返回空数据时的后备数据 | `
OptionsItem
[
]
` | - | - |
| visibleEvent | 触发重新请求数据的事件名 | `
string
` | - | - |
| loadingSlot | 目标组件的插槽名称,用来显示一个"加载中"的图标 | `
string
` | - | - |
| autoSelect | 自动设置选项 | `
'first'
\|
'last'
\|
'one'
\|
(
item: OptionsItem
[
]) => OptionsItem
\|
false
` | `
false
` | >5.5.4 |
| autoSelect | 自动设置选项 | `
'first'
\|
'last'
\|
'one'
\|
(
(item: OptionsItem
[
]) => OptionsItem)
\|
false
` | `
false
` | >5.5.4 |
#### autoSelect 自动设置选项
如果当前值为undefined,在选项数据成功加载之后,自动从备选项中选择一个作为当前值。默认值为`
false
`,即不自动选择选项。注意:该属性不应用于多选组件。可选值有:
- `
first
`:自动选择第一个选项
- `
last
`:自动选择最后一个选项
- `
one
`:有且仅有一个选项时,自动选择它
- `
函数
`
:自定义选择逻辑,函数的参数为options,返回值为选择的选项
-
false
:不自动选择选项
- `
"first"
`:自动选择第一个选项
- `
"last"
`:自动选择最后一个选项
- `
"one"
`:有且仅有一个选项时,自动选择它
- `
自定义
函数
`:自定义选择逻辑,函数的参数为options,返回值为选择的选项
-
`
false
`
:不自动选择选项
### Methods
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment