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 dedba185
authored
Nov 27, 2024
by
Netfan
Committed by
GitHub
Nov 27, 2024
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
feat: add `confirmDisabled` for `Dialog` (#4959)
1 parent
f85badf4
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
11 additions
and
3 deletions
docs/src/components/common-ui/vben-modal.md
packages/@core/ui-kit/popup-ui/src/modal/modal-api.ts
packages/@core/ui-kit/popup-ui/src/modal/modal.ts
packages/@core/ui-kit/popup-ui/src/modal/modal.vue
playground/src/views/examples/modal/auto-height-demo.vue
docs/src/components/common-ui/vben-modal.md
View file @
dedba18
...
...
@@ -93,13 +93,14 @@ const [Modal, modalApi] = useVbenModal({
| modal | 显示遮罩 |
`boolean`
|
`true`
|
| header | 显示header |
`boolean`
|
`true`
|
| footer | 显示footer |
`boolean\|slot`
|
`true`
|
| confirmDisabled | 禁用确认按钮 |
`boolean`
|
`false`
|
| confirmLoading | 确认按钮loading状态 |
`boolean`
|
`false`
|
| closeOnClickModal | 点击遮罩关闭弹窗 |
`boolean`
|
`true`
|
| closeOnPressEscape | esc 关闭弹窗 |
`boolean`
|
`true`
|
| confirmText | 确认按钮文本 |
`string\|slot`
|
`确认`
|
| cancelText | 取消按钮文本 |
`string\|slot`
|
`取消`
|
| showCancelButton | 显示取消按钮 |
`boolean`
|
`true`
|
| showConfirmButton | 显示确认按钮
文本
|
`boolean`
|
`true`
|
| showConfirmButton | 显示确认按钮 |
`boolean`
|
`true`
|
| class | modal的class,宽度通过这个配置 |
`string`
| - |
| contentClass | modal内容区域的class |
`string`
| - |
| footerClass | modal底部区域的class |
`string`
| - |
...
...
packages/@core/ui-kit/popup-ui/src/modal/modal-api.ts
View file @
dedba18
...
...
@@ -41,6 +41,7 @@ export class ModalApi {
class
:
''
,
closeOnClickModal
:
true
,
closeOnPressEscape
:
true
,
confirmDisabled
:
false
,
confirmLoading
:
false
,
contentClass
:
''
,
draggable
:
false
,
...
...
packages/@core/ui-kit/popup-ui/src/modal/modal.ts
View file @
dedba18
...
...
@@ -36,6 +36,10 @@ export interface ModalProps {
*/
closeOnPressEscape
?:
boolean
;
/**
* 禁用确认按钮
*/
confirmDisabled
?:
boolean
;
/**
* 确定按钮 loading
* @default false
*/
...
...
packages/@core/ui-kit/popup-ui/src/modal/modal.vue
View file @
dedba18
...
...
@@ -59,6 +59,7 @@ const {
closable
,
closeOnClickModal
,
closeOnPressEscape
,
confirmDisabled
,
confirmLoading
,
confirmText
,
contentClass
,
...
...
@@ -285,6 +286,7 @@ function handleFocusOutside(e: Event) {
<component
:is=
"components.PrimaryButton || VbenButton"
v-if=
"showConfirmButton"
:disabled=
"confirmDisabled"
:loading=
"confirmLoading"
@
click=
"() => modalApi?.onConfirm()"
>
...
...
playground/src/views/examples/modal/auto-height-demo.vue
View file @
dedba18
...
...
@@ -22,10 +22,10 @@ const [Modal, modalApi] = useVbenModal({
});
function
handleUpdate
(
len
:
number
)
{
modalApi
.
setState
({
loading
:
true
});
modalApi
.
setState
({
confirmDisabled
:
true
,
loading
:
true
});
setTimeout
(()
=>
{
list
.
value
=
Array
.
from
({
length
:
len
},
(
_v
,
k
)
=>
k
+
1
);
modalApi
.
setState
({
loading
:
false
});
modalApi
.
setState
({
confirmDisabled
:
false
,
loading
:
false
});
},
2000
);
}
</
script
>
...
...
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