Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Unverified
Commit
f37fcefd
authored
Jun 15, 2025
by
芋道源码
Committed by
Gitee
Jun 15, 2025
Browse files
Options
Browse Files
Download
Plain Diff
!740 修复弹窗表单重复提交的问题
Merge pull request !740 from tzdxf/fix-dialog-submit
parents
0879cdd1
22ba3895
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
2 deletions
+18
-2
src/components/Dialog/src/Dialog.vue
+18
-2
No files found.
src/components/Dialog/src/Dialog.vue
View file @
f37fcefd
<
script
lang=
"ts"
setup
>
<
script
lang=
"ts"
setup
>
import
{
propTypes
}
from
'@/utils/propTypes'
import
{
propTypes
}
from
'@/utils/propTypes'
import
{
isNumber
}
from
'@/utils/is'
import
{
isNumber
}
from
'@/utils/is'
defineOptions
({
name
:
'Dialog'
})
defineOptions
({
name
:
'Dialog'
})
const
slots
=
useSlots
()
const
slots
=
useSlots
()
const
emits
=
defineEmits
([
'update:modelValue'
])
const
props
=
defineProps
({
const
props
=
defineProps
({
modelValue
:
propTypes
.
bool
.
def
(
false
),
modelValue
:
propTypes
.
bool
.
def
(
false
),
...
@@ -55,6 +57,17 @@ const dialogStyle = computed(() => {
...
@@ -55,6 +57,17 @@ const dialogStyle = computed(() => {
height
:
unref
(
dialogHeight
)
height
:
unref
(
dialogHeight
)
}
}
})
})
const
closing
=
ref
(
false
)
function
closeHandler
()
{
emits
(
'update:modelValue'
,
false
)
closing
.
value
=
true
}
function
closedHandler
()
{
closing
.
value
=
false
}
</
script
>
</
script
>
<
template
>
<
template
>
...
@@ -68,7 +81,8 @@ const dialogStyle = computed(() => {
...
@@ -68,7 +81,8 @@ const dialogStyle = computed(() => {
draggable
draggable
class=
"com-dialog"
class=
"com-dialog"
:show-close=
"false"
:show-close=
"false"
@
close=
"$emit('update:modelValue', false)"
@
close=
"closeHandler"
@
closed=
"closedHandler"
>
>
<template
#
header=
"
{ close }">
<template
#
header=
"
{ close }">
<div
class=
"relative h-54px flex items-center justify-between pl-15px pr-15px"
>
<div
class=
"relative h-54px flex items-center justify-between pl-15px pr-15px"
>
...
@@ -102,7 +116,9 @@ const dialogStyle = computed(() => {
...
@@ -102,7 +116,9 @@ const dialogStyle = computed(() => {
</ElScrollbar>
</ElScrollbar>
<slot
v-else
></slot>
<slot
v-else
></slot>
<
template
v-if=
"slots.footer"
#
footer
>
<
template
v-if=
"slots.footer"
#
footer
>
<slot
name=
"footer"
></slot>
<div
:style=
"
{ 'pointer-events': closing ? 'none' : 'auto' }">
<slot
name=
"footer"
></slot>
</div>
</
template
>
</
template
>
</ElDialog>
</ElDialog>
</template>
</template>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment