From f3c23a2bc1a214420d16d0b8e11d888aa0cd97fd Mon Sep 17 00:00:00 2001 From: tjz <415800467@qq.com> Date: Sat, 20 Jan 2018 20:24:42 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=20trigger?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/trigger/Popup.vue | 19 ++-- components/trigger/index.vue | 119 ++++++++++++----------- package.json | 180 +++++++++++++++++------------------ 3 files changed, 165 insertions(+), 153 deletions(-) diff --git a/components/trigger/Popup.vue b/components/trigger/Popup.vue index e5d329cdc..5eac33715 100644 --- a/components/trigger/Popup.vue +++ b/components/trigger/Popup.vue @@ -26,13 +26,14 @@ export default { data () { return { destroyPopup: false, - initAlign: false, // mounted之后再实例化align,即改变this.$el位置后实例化 + initAlign: false, // mounted之后再实例化align,即改变this.$el位置后实例化,避免位置计算不正确 } }, mounted () { this.rootNode = this.getPopupDomNode() this._container = this.getContainer() this._container.appendChild(this.$el) + this.$nextTick(() => { this.initAlign = true }) @@ -46,14 +47,14 @@ export default { this.destroyPopup = false } }, - initAlign (val) { - if (val) { - this.$nextTick(() => { - // console.log(this.$refs.alignInstance.$el) - // this.$refs.alignInstance.forceAlign() - }) - } - }, + // initAlign (val) { + // if (val) { + // this.$nextTick(() => { + // // console.log(this.$refs.alignInstance.$el) + // // this.$refs.alignInstance.forceAlign() + // }) + // } + // }, }, methods: { onAlign (popupDomNode, align) { diff --git a/components/trigger/index.vue b/components/trigger/index.vue index 8aeaecc1a..57cb3f2e2 100644 --- a/components/trigger/index.vue +++ b/components/trigger/index.vue @@ -1,4 +1,5 @@