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;
zIndex.value = ++globalZIndex;
emit('open');
}
};
const close = () => {
if (opened) {
opened = false;
emit('close');
emit('update:show', false);
}
};
@ -211,10 +214,8 @@ export default defineComponent({
(value) => {
if (value) {
open();
emit('open');
} else {
close();
emit('close');
}
}
);