背景:当页面数据过多需要滚动时,展开Select组件或Dropdown组件的下拉框后,滚轮页面,下拉框会跟着上下滑动
<a-select
v-model="k.propertyContent"
:filter-option="filterOptionSelect"
show-search
ref="entitySel"
option-label-prop="label"
:getPopupContainer="(triggerNode) => triggerNode.parentNode"
>
<a-select-option
v-for="item in selectObj[k.propertyValue]"
:value="item.id"
:key="item.id"
:label="item.entityName"
>
{{ item.entityName }}
</a-select-option>
</a-select>
解决方案:
查阅API得知
:getPopupContainer="(triggerNode) => triggerNode.parentNode"