fix(ImagePreview): close event triggered twice (#5411)

This commit is contained in:
neverland
2019-12-28 08:43:57 +08:00
committed by GitHub
parent 93e6c81c49
commit 8dea26db95
11 changed files with 234 additions and 254 deletions
+9 -5
View File
@@ -31,13 +31,17 @@ function onClickOverlay(): void {
}
}
function mountOverlay() {
overlay = mount(Overlay, {
on: {
click: onClickOverlay
}
});
}
export function updateOverlay(): void {
if (!overlay) {
overlay = mount(Overlay, {
on: {
click: onClickOverlay
}
});
mountOverlay();
}
if (context.top) {