fix(Popup): missing open、close event in some cases (#9065)

This commit is contained in:
neverland 2021-07-19 15:06:14 +08:00 committed by GitHub
parent 1b84a9166d
commit 2b0fdc4e26
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -110,12 +110,15 @@ export default defineComponent({
opened = true; opened = true;
zIndex.value = ++globalZIndex; zIndex.value = ++globalZIndex;
emit('open');
} }
}; };
const close = () => { const close = () => {
if (opened) { if (opened) {
opened = false; opened = false;
emit('close');
emit('update:show', false); emit('update:show', false);
} }
}; };
@ -211,10 +214,8 @@ export default defineComponent({
(value) => { (value) => {
if (value) { if (value) {
open(); open();
emit('open');
} else { } else {
close(); close();
emit('close');
} }
} }
); );