From f354d877aa058b00a9b656cf5de0278f3206db1c Mon Sep 17 00:00:00 2001 From: tangjinzhou <415800467@qq.com> Date: Tue, 30 Jan 2018 17:59:34 +0800 Subject: [PATCH] fix --- components/trigger/Popup.vue | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/components/trigger/Popup.vue b/components/trigger/Popup.vue index 5eac33715..bc2b47d8a 100644 --- a/components/trigger/Popup.vue +++ b/components/trigger/Popup.vue @@ -30,7 +30,6 @@ export default { } }, mounted () { - this.rootNode = this.getPopupDomNode() this._container = this.getContainer() this._container.appendChild(this.$el) @@ -41,20 +40,20 @@ export default { beforeDestroy () { this.$el.remove() }, + beforeUpdate () { + const newContainer = this.getContainer() + if (newContainer !== this._container) { + this._container = newContainer + this._container.appendChild(this.$el) + this.$refs.alignInstance.forceAlign() + } + }, watch: { visible (val) { if (val) { this.destroyPopup = false } }, - // initAlign (val) { - // if (val) { - // this.$nextTick(() => { - // // console.log(this.$refs.alignInstance.$el) - // // this.$refs.alignInstance.forceAlign() - // }) - // } - // }, }, methods: { onAlign (popupDomNode, align) {