Netfan
10 months ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
7 additions and
4 deletions
-
packages/@core/ui-kit/popup-ui/src/alert/alert.vue
|
|
|
@ -47,6 +47,10 @@ function onAlertClosed() { |
|
|
|
isConfirm.value = false; |
|
|
|
} |
|
|
|
|
|
|
|
function onEscapeKeyDown() { |
|
|
|
isConfirm.value = false; |
|
|
|
} |
|
|
|
|
|
|
|
const getIconRender = computed(() => { |
|
|
|
let iconRender: Component | null = null; |
|
|
|
if (props.icon) { |
|
|
|
@ -116,13 +120,11 @@ function handleCancel() { |
|
|
|
|
|
|
|
const loading = ref(false); |
|
|
|
async function handleOpenChange(val: boolean) { |
|
|
|
const confirmState = isConfirm.value; |
|
|
|
isConfirm.value = false; |
|
|
|
await nextTick(); |
|
|
|
await nextTick(); // 等待标记isConfirm状态 |
|
|
|
if (!val && props.beforeClose) { |
|
|
|
loading.value = true; |
|
|
|
try { |
|
|
|
const res = await props.beforeClose({ isConfirm: confirmState }); |
|
|
|
const res = await props.beforeClose({ isConfirm: isConfirm.value }); |
|
|
|
if (res !== false) { |
|
|
|
open.value = false; |
|
|
|
} |
|
|
|
@ -142,6 +144,7 @@ async function handleOpenChange(val: boolean) { |
|
|
|
:overlay-blur="overlayBlur" |
|
|
|
@opened="emits('opened')" |
|
|
|
@closed="onAlertClosed" |
|
|
|
@escape-key-down="onEscapeKeyDown" |
|
|
|
:class=" |
|
|
|
cn( |
|
|
|
containerClass, |
|
|
|
|