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 14377705
authored
Apr 23, 2025
by
Netfan
Committed by
GitHub
Apr 23, 2025
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix: alert confirm state in beforeClose callback (#6019)
1 parent
b985ff05
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
packages/@core/ui-kit/popup-ui/src/alert/alert.vue
packages/@core/ui-kit/popup-ui/src/alert/alert.vue
View file @
1437770
...
@@ -47,6 +47,10 @@ function onAlertClosed() {
...
@@ -47,6 +47,10 @@ function onAlertClosed() {
isConfirm
.
value
=
false
;
isConfirm
.
value
=
false
;
}
}
function
onEscapeKeyDown
()
{
isConfirm
.
value
=
false
;
}
const
getIconRender
=
computed
(()
=>
{
const
getIconRender
=
computed
(()
=>
{
let
iconRender
:
Component
|
null
=
null
;
let
iconRender
:
Component
|
null
=
null
;
if
(
props
.
icon
)
{
if
(
props
.
icon
)
{
...
@@ -116,13 +120,11 @@ function handleCancel() {
...
@@ -116,13 +120,11 @@ function handleCancel() {
const
loading
=
ref
(
false
);
const
loading
=
ref
(
false
);
async
function
handleOpenChange
(
val
:
boolean
)
{
async
function
handleOpenChange
(
val
:
boolean
)
{
const
confirmState
=
isConfirm
.
value
;
await
nextTick
();
// 等待标记isConfirm状态
isConfirm
.
value
=
false
;
await
nextTick
();
if
(
!
val
&&
props
.
beforeClose
)
{
if
(
!
val
&&
props
.
beforeClose
)
{
loading
.
value
=
true
;
loading
.
value
=
true
;
try
{
try
{
const
res
=
await
props
.
beforeClose
({
isConfirm
:
confirmStat
e
});
const
res
=
await
props
.
beforeClose
({
isConfirm
:
isConfirm
.
valu
e
});
if
(
res
!==
false
)
{
if
(
res
!==
false
)
{
open
.
value
=
false
;
open
.
value
=
false
;
}
}
...
@@ -142,6 +144,7 @@ async function handleOpenChange(val: boolean) {
...
@@ -142,6 +144,7 @@ async function handleOpenChange(val: boolean) {
:overlay-blur=
"overlayBlur"
:overlay-blur=
"overlayBlur"
@
opened=
"emits('opened')"
@
opened=
"emits('opened')"
@
closed=
"onAlertClosed"
@
closed=
"onAlertClosed"
@
escape-key-down=
"onEscapeKeyDown"
:class=
"
:class=
"
cn(
cn(
containerClass,
containerClass,
...
...
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