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 27ba45aa
authored
Dec 30, 2024
by
Netfan
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
docs: update dialog and drawer docs
1 parent
de170077
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
0 deletions
docs/src/components/common-ui/vben-drawer.md
docs/src/components/common-ui/vben-modal.md
docs/src/components/common-ui/vben-drawer.md
View file @
27ba45a
...
@@ -54,6 +54,7 @@ Drawer 内的内容一般业务中,会比较复杂,所以我们可以将 dra
...
@@ -54,6 +54,7 @@ Drawer 内的内容一般业务中,会比较复杂,所以我们可以将 dra
-
`VbenDrawer`
组件对与参数的处理优先级是
`slot`
>
`props`
>
`state`
(通过api更新的状态以及useVbenDrawer参数)。如果你已经传入了
`slot`
或者
`props`
,那么
`setState`
将不会生效,这种情况下你可以通过
`slot`
或者
`props`
来更新状态。
-
`VbenDrawer`
组件对与参数的处理优先级是
`slot`
>
`props`
>
`state`
(通过api更新的状态以及useVbenDrawer参数)。如果你已经传入了
`slot`
或者
`props`
,那么
`setState`
将不会生效,这种情况下你可以通过
`slot`
或者
`props`
来更新状态。
-
如果你使用到了
`connectedComponent`
参数,那么会存在 2 个
`useVbenDrawer`
, 此时,如果同时设置了相同的参数,那么以内部为准(也就是没有设置 connectedComponent 的代码)。比如 同时设置了
`onConfirm`
,那么以内部的
`onConfirm`
为准。
`onOpenChange`
事件除外,内外都会触发。
-
如果你使用到了
`connectedComponent`
参数,那么会存在 2 个
`useVbenDrawer`
, 此时,如果同时设置了相同的参数,那么以内部为准(也就是没有设置 connectedComponent 的代码)。比如 同时设置了
`onConfirm`
,那么以内部的
`onConfirm`
为准。
`onOpenChange`
事件除外,内外都会触发。
-
使用了
`connectedComponent`
参数时,可以配置
`destroyOnClose`
属性来决定当关闭弹窗时,是否要销毁
`connectedComponent`
组件(重新创建
`connectedComponent`
组件,这将会把其内部所有的变量、状态、数据等恢复到初始状态。)。
:::
:::
...
@@ -75,6 +76,8 @@ const [Drawer, drawerApi] = useVbenDrawer({
...
@@ -75,6 +76,8 @@ const [Drawer, drawerApi] = useVbenDrawer({
| 属性名 | 描述 | 类型 | 默认值 |
| 属性名 | 描述 | 类型 | 默认值 |
| --- | --- | --- | --- |
| --- | --- | --- | --- |
| appendToMain | 是否挂载到内容区域(默认挂载到body) |
`boolean`
|
`false`
|
| appendToMain | 是否挂载到内容区域(默认挂载到body) |
`boolean`
|
`false`
|
| connectedComponent | 连接另一个Modal组件 |
`Component`
| - |
| destroyOnClose | 关闭时销毁
`connectedComponent`
|
`boolean`
|
`false`
|
| title | 标题 |
`string\|slot`
| - |
| title | 标题 |
`string\|slot`
| - |
| titleTooltip | 标题提示信息 |
`string\|slot`
| - |
| titleTooltip | 标题提示信息 |
`string\|slot`
| - |
| description | 描述信息 |
`string\|slot`
| - |
| description | 描述信息 |
`string\|slot`
| - |
...
...
docs/src/components/common-ui/vben-modal.md
View file @
27ba45a
...
@@ -60,6 +60,7 @@ Modal 内的内容一般业务中,会比较复杂,所以我们可以将 moda
...
@@ -60,6 +60,7 @@ Modal 内的内容一般业务中,会比较复杂,所以我们可以将 moda
-
`VbenModal`
组件对与参数的处理优先级是
`slot`
>
`props`
>
`state`
(通过api更新的状态以及useVbenModal参数)。如果你已经传入了
`slot`
或者
`props`
,那么
`setState`
将不会生效,这种情况下你可以通过
`slot`
或者
`props`
来更新状态。
-
`VbenModal`
组件对与参数的处理优先级是
`slot`
>
`props`
>
`state`
(通过api更新的状态以及useVbenModal参数)。如果你已经传入了
`slot`
或者
`props`
,那么
`setState`
将不会生效,这种情况下你可以通过
`slot`
或者
`props`
来更新状态。
-
如果你使用到了
`connectedComponent`
参数,那么会存在 2 个
`useVbenModal`
, 此时,如果同时设置了相同的参数,那么以内部为准(也就是没有设置 connectedComponent 的代码)。比如 同时设置了
`onConfirm`
,那么以内部的
`onConfirm`
为准。
`onOpenChange`
事件除外,内外都会触发。
-
如果你使用到了
`connectedComponent`
参数,那么会存在 2 个
`useVbenModal`
, 此时,如果同时设置了相同的参数,那么以内部为准(也就是没有设置 connectedComponent 的代码)。比如 同时设置了
`onConfirm`
,那么以内部的
`onConfirm`
为准。
`onOpenChange`
事件除外,内外都会触发。
-
使用了
`connectedComponent`
参数时,可以配置
`destroyOnClose`
属性来决定当关闭弹窗时,是否要销毁
`connectedComponent`
组件(重新创建
`connectedComponent`
组件,这将会把其内部所有的变量、状态、数据等恢复到初始状态。)。
:::
:::
...
@@ -81,6 +82,8 @@ const [Modal, modalApi] = useVbenModal({
...
@@ -81,6 +82,8 @@ const [Modal, modalApi] = useVbenModal({
| 属性名 | 描述 | 类型 | 默认值 |
| 属性名 | 描述 | 类型 | 默认值 |
| --- | --- | --- | --- |
| --- | --- | --- | --- |
| appendToMain | 是否挂载到内容区域(默认挂载到body) |
`boolean`
|
`false`
|
| appendToMain | 是否挂载到内容区域(默认挂载到body) |
`boolean`
|
`false`
|
| connectedComponent | 连接另一个Modal组件 |
`Component`
| - |
| destroyOnClose | 关闭时销毁
`connectedComponent`
|
`boolean`
|
`false`
|
| title | 标题 |
`string\|slot`
| - |
| title | 标题 |
`string\|slot`
| - |
| titleTooltip | 标题提示信息 |
`string\|slot`
| - |
| titleTooltip | 标题提示信息 |
`string\|slot`
| - |
| description | 描述信息 |
`string\|slot`
| - |
| description | 描述信息 |
`string\|slot`
| - |
...
...
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