当下拉内容过多时,a-tree-select下拉选择框会直接撑高到整个页面,即如下效果:
此时可以通过:dropdown-style="{ maxHeight: '500px', overflow: 'auto' }"限制下拉框高度,限制高度后会出现滚动条,下拉框宽度会超出选择器,需要使用:dropdownMatchSelectWidth = "true"让下拉款与选择器同宽,具体代码:
<a-tree-select
v-model="value"
style="width: 80%"
:tree-data="DataTree"
dropdownMatchSelectWidth = "true"
:dropdown-style="{ maxHeight: '500px', overflow: 'auto' }"
allowClear
multiple
placeholder="请选择(可多选)"
/>