Commit 62725de37694724bce4210e5437b425d2d77f9d5
Committed by
GitHub
Merge pull request #4751 from RookieZoe/2.0-bug-fix
[Select, AutoComplete] 当选项列表中的 dropdown 在控件上部显示时的一个BUG
Showing
1 changed file
with
8 additions
and
1 deletions
Show diff stats
src/components/select/select.vue
@@ -753,7 +753,14 @@ | @@ -753,7 +753,14 @@ | ||
753 | }, | 753 | }, |
754 | visible(state){ | 754 | visible(state){ |
755 | this.$emit('on-open-change', state); | 755 | this.$emit('on-open-change', state); |
756 | - } | 756 | + }, |
757 | + slotOptions(options, old){ | ||
758 | + // 当 dropdown 在控件上部显示时,如果选项列表的长度由外部动态变更了, | ||
759 | + // dropdown 的位置会有点问题,需要重新计算 | ||
760 | + if (options && old && options.length !== old.length) { | ||
761 | + this.broadcast('Drop', 'on-update-popper'); | ||
762 | + } | ||
763 | + }, | ||
757 | } | 764 | } |
758 | }; | 765 | }; |
759 | </script> | 766 | </script> |