From e09b07b79cc5962671966b9d42bac7e7cdf6f993 Mon Sep 17 00:00:00 2001 From: huanghong Date: Fri, 16 Mar 2018 00:43:11 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E8=A7=A3=E5=86=B3drop=E5=BC=B9=E5=87=BA?= =?UTF-8?q?=E5=8A=A8=E7=94=BB=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/cascader/cascader.vue | 2 +- src/components/date-picker/picker.vue | 2 +- src/components/dropdown/dropdown.vue | 2 +- src/components/select/dropdown.vue | 7 +++++++ src/components/select/select.vue | 2 +- src/styles/animation/slide.less | 23 +++++++++++++++++++++++ 6 files changed, 34 insertions(+), 4 deletions(-) diff --git a/src/components/cascader/cascader.vue b/src/components/cascader/cascader.vue index 6d8c945f..22206acf 100644 --- a/src/components/cascader/cascader.vue +++ b/src/components/cascader/cascader.vue @@ -20,7 +20,7 @@ - + - +
- + { + this.resetTransformOrigin(); } }); }); @@ -64,6 +67,10 @@ } }, 300); } + }, + resetTransformOrigin() { + let placement = this.popper.popper.getAttribute('x-placement').split('-')[0]; + this.popper.popper.style.transformOrigin = placement==='bottom'?'center top':'center bottom'; } }, created () { diff --git a/src/components/select/select.vue b/src/components/select/select.vue index 3798a397..7a8ea3fd 100644 --- a/src/components/select/select.vue +++ b/src/components/select/select.vue @@ -35,7 +35,7 @@ - + Date: Fri, 16 Mar 2018 00:53:57 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E8=A7=A3=E5=86=B3dropdown=E5=BC=B9?= =?UTF-8?q?=E5=87=BA=E6=9D=A5=E4=B9=8B=E5=90=8E=E6=94=B9=E5=8F=98=E4=BD=8D?= =?UTF-8?q?=E7=BD=AE=E5=8A=A8=E7=94=BB=E8=BF=98=E6=98=AF=E4=B8=8A=E6=AC=A1?= =?UTF-8?q?=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/select/dropdown.vue | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/components/select/dropdown.vue b/src/components/select/dropdown.vue index 51f6ed00..44a163c0 100644 --- a/src/components/select/dropdown.vue +++ b/src/components/select/dropdown.vue @@ -49,6 +49,9 @@ }, onCreate:()=>{ this.resetTransformOrigin(); + }, + onUpdate:()=>{ + this.resetTransformOrigin(); } }); });