From 0f58570a1fd274943289912c8c2663d297541b21 Mon Sep 17 00:00:00 2001 From: Rookie_Zoe Date: Thu, 25 Oct 2018 18:20:16 +0800 Subject: [PATCH] =?UTF-8?q?[Select,=20AutoComplete]=20=E5=BD=93=E9=80=89?= =?UTF-8?q?=E9=A1=B9=E5=88=97=E8=A1=A8=E4=B8=AD=E7=9A=84=20dropdown=20?= =?UTF-8?q?=E5=9C=A8=E6=8E=A7=E4=BB=B6=E4=B8=8A=E9=83=A8=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=20=E5=A6=82=E6=9E=9C=E9=80=89=E9=A1=B9?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E7=9A=84=E9=95=BF=E5=BA=A6=E7=94=B1=E5=A4=96?= =?UTF-8?q?=E9=83=A8=E5=8A=A8=E6=80=81=E5=8F=98=E6=9B=B4=E4=BA=86=EF=BC=8C?= =?UTF-8?q?dropdown=20=E7=9A=84=E4=BD=8D=E7=BD=AE=E4=BC=9A=E6=9C=89?= =?UTF-8?q?=E7=82=B9=E9=97=AE=E9=A2=98=EF=BC=8C=E9=9C=80=E8=A6=81=E9=87=8D?= =?UTF-8?q?=E6=96=B0=E8=AE=A1=E7=AE=97.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/select/select.vue | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/components/select/select.vue b/src/components/select/select.vue index 0acc3b66..8aaca7d5 100644 --- a/src/components/select/select.vue +++ b/src/components/select/select.vue @@ -753,7 +753,14 @@ }, visible(state){ this.$emit('on-open-change', state); - } + }, + slotOptions(options, old){ + // 当 dropdown 在控件上部显示时,如果选项列表的长度由外部动态变更了, + // dropdown 的位置会有点问题,需要重新计算 + if (options && old && options.length !== old.length) { + this.broadcast('Drop', 'on-update-popper'); + } + }, } };