首页 > 其他分享 >[ant-design] a-select,a-date-picker 下拉菜单不跟着滚动走(getPopupContainer)

[ant-design] a-select,a-date-picker 下拉菜单不跟着滚动走(getPopupContainer)

时间:2023-03-25 12:06:19浏览次数:39  
标签:picker triggerNode parentNode ant date 下拉菜单 select


问题:

[ant-design] a-select,a-date-picker 下拉菜单不跟着滚动走(getPopupContainer)_javascript


a-select

<a-select :getPopupContainer="(triggerNode) => triggerNode.parentNode" ></a-select>

a-date-picker

<a-date-picker :getCalendarContainer="(triggerNode) => triggerNode.parentNode" />

或者可以手动指定到对应的节点上

<a-select :getPopupContainer="() => document.getElementById('xxx')" ></a-select>

注意去每个控件的文档里面去看看是否有支持修改渲染容器的方法属性

[ant-design] a-select,a-date-picker 下拉菜单不跟着滚动走(getPopupContainer)_前端_02


[ant-design] a-select,a-date-picker 下拉菜单不跟着滚动走(getPopupContainer)_javascript_03




参考:

Vue antdv 下拉菜单不跟着滚动走(getPopupContainer 使用)


标签:picker,triggerNode,parentNode,ant,date,下拉菜单,select
From: https://blog.51cto.com/u_12881709/6149123

相关文章