소스 검색

Dialog: remove DOM node after destroyed when appendToBody (#9005)

* Form: fix async validate bug

* Form: fix async validate bug

* When dialo's <appendToBody> is true, remove DOM node after destory
Allenice 7 년 전
부모
커밋
5e06a1a463
1개의 변경된 파일7개의 추가작업 그리고 0개의 파일을 삭제
  1. 7 0
      packages/dialog/src/component.vue

+ 7 - 0
packages/dialog/src/component.vue

@@ -177,6 +177,13 @@
           document.body.appendChild(this.$el);
         }
       }
+    },
+
+    destroyed() {
+      // if appendToBody is true, remove DOM node after destroy
+      if (this.appendToBody && this.$el) {
+        this.$el.parentNode.removeChild(this.$el);
+      }
     }
   };
 </script>