Skip to content

Commit

Permalink
[+] 销毁前需要移除dialog创建的DOM (#2581)
Browse files Browse the repository at this point in the history
  • Loading branch information
loganylwu committed Jul 18, 2023
1 parent 91325ea commit 4eaa1f3
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/dialog/dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ export default mixins(ActionMixin, getConfigReceiverMixins<Vue, DialogConfig>('d
beforeDestroy() {
this.addKeyboardEvent(false);
this.destroySelf();
this.destroySelfStyle();
},

directives: {
Expand All @@ -219,14 +220,18 @@ export default mixins(ActionMixin, getConfigReceiverMixins<Vue, DialogConfig>('d
clearStyleFunc() {
clearTimeout(this.timer);
this.timer = setTimeout(() => {
this.destroySelf();
this.destroySelfStyle();
}, 150);
},

destroySelf() {
destroySelfStyle() {
this.styleEl.parentNode?.removeChild?.(this.styleEl);
},

destroySelf() {
this.$el.parentNode?.removeChild?.(this.$el);
},

storeUid(flag: boolean) {
if (flag) {
stack.push(this.uid);
Expand Down

0 comments on commit 4eaa1f3

Please sign in to comment.