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 3f0d3089
authored
Mar 23, 2025
by
Netfan
Committed by
GitHub
Mar 23, 2025
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix: menu drawer can not be closed after a successful submitting (#5770)
1 parent
66c1d390
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
18 deletions
playground/src/views/system/menu/modules/form.vue
playground/src/views/system/menu/modules/form.vue
View file @
3f0d308
...
@@ -32,7 +32,6 @@ const emit = defineEmits<{
...
@@ -32,7 +32,6 @@ const emit = defineEmits<{
success
:
[];
success
:
[];
}
>
();
}
>
();
const
formData
=
ref
<
SystemMenuApi
.
SystemMenu
>
();
const
formData
=
ref
<
SystemMenuApi
.
SystemMenu
>
();
const
loading
=
ref
(
false
);
const
titleSuffix
=
ref
<
string
>
();
const
titleSuffix
=
ref
<
string
>
();
const
schema
:
VbenFormSchema
[]
=
[
const
schema
:
VbenFormSchema
[]
=
[
{
{
...
@@ -445,9 +444,6 @@ const [Form, formApi] = useVbenForm({
...
@@ -445,9 +444,6 @@ const [Form, formApi] = useVbenForm({
});
});
const
[
Drawer
,
drawerApi
]
=
useVbenDrawer
({
const
[
Drawer
,
drawerApi
]
=
useVbenDrawer
({
onBeforeClose
()
{
if
(
loading
.
value
)
return
false
;
},
onConfirm
:
onSubmit
,
onConfirm
:
onSubmit
,
onOpenChange
(
isOpen
)
{
onOpenChange
(
isOpen
)
{
if
(
isOpen
)
{
if
(
isOpen
)
{
...
@@ -474,13 +470,7 @@ const [Drawer, drawerApi] = useVbenDrawer({
...
@@ -474,13 +470,7 @@ const [Drawer, drawerApi] = useVbenDrawer({
async
function
onSubmit
()
{
async
function
onSubmit
()
{
const
{
valid
}
=
await
formApi
.
validate
();
const
{
valid
}
=
await
formApi
.
validate
();
if
(
valid
)
{
if
(
valid
)
{
loading
.
value
=
true
;
drawerApi
.
lock
();
drawerApi
.
setState
({
closeOnClickModal
:
false
,
closeOnPressEscape
:
false
,
confirmLoading
:
true
,
loading
:
true
,
});
const
data
=
const
data
=
await
formApi
.
getValues
<
await
formApi
.
getValues
<
Omit
<
SystemMenuApi
.
SystemMenu
,
'children'
|
'id'
>
Omit
<
SystemMenuApi
.
SystemMenu
,
'children'
|
'id'
>
...
@@ -498,13 +488,7 @@ async function onSubmit() {
...
@@ -498,13 +488,7 @@ async function onSubmit() {
drawerApi
.
close
();
drawerApi
.
close
();
emit
(
'success'
);
emit
(
'success'
);
}
finally
{
}
finally
{
loading
.
value
=
false
;
drawerApi
.
unlock
();
drawerApi
.
setState
({
closeOnClickModal
:
true
,
closeOnPressEscape
:
true
,
confirmLoading
:
false
,
loading
:
false
,
});
}
}
}
}
}
}
...
...
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