a-select 下拉列表正常展示
<a-form-item label="内容">
<a-select
allowClear
placeholder="请选择"
:getPopupContainer="getPopupContainer"
v-decorator="[
'contentId',
{
rules: [{ required: true, message: '请选择内容' }]
}
]"
@change="(value) => contentChange(value, item)"
>
<a-select-option
v-for="it in contentOptions"
:key="it.id"
>{{it.alertName}}</a-select-option>
</a-select>
</a-form-item>
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
设置 :getPopupContainer="getPopupContainer"相对于父元素
//设置层级关系
getPopupContainer() {
return document.body; // 将下拉列表的父级容器设置为 body 元素
},