Ant Design vue Modal 中Select组件下拉选项随页面滚动与Select框分离异常
Select
<a-form-item label="承运商:" :label-col="{ span: 4 }" :wrapper-col="{ span: 20 }">
<a-select class="W300"
:filterOption="filterOption"
allowClear
showSearch
@change="handleChange"
placeholder="请选择"
:getPopupContainer="(triggerNode)=>{ return triggerNode.parentNode}"//新增加这个定位
v-decorator="['carrierId',{rules: [{ required: true, message: '承运商' }]}]"
>
<a-select-option
v-for="(item,index) in carrierList"
:value="item.companyId"
:key="index"
>
{{item.companyName}}
</a-select-option>
</a-select>
</a-form-item>
Cascader
<a-form-item label="始发地:" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
<a-cascader
:options="options"
@change="changecityFrom"
placeholder="请输入"
:getPopupContainer="(triggerNode)=>{ return triggerNode.parentNode}" //新增加这个定位
v-decorator="['fromcity',{rules: [{ required: true, message: '请选择经营省市区'},
{validator:this.startChange}]}]"
/>
</a-form-item>