修改选择器的下拉框,下拉框是在body标签的外面所以要设置
:popper-append-to-body="false"
把下拉框放进body里面
再自定义类名
popper-class="select-popper"
.select-popper .el-select-dropdown__item { height: 77px !important; line-height: 37px !important; }
完整代码
<el-select v-model="value" placeholder="请选择" @change="Addresschange" class="select_show" :popper-append-to-body="false" popper-class="select-popper"> <el-option v-for="item in AddressList" :key="item.address_id" :label="item.name" :value="item.address_id" > <div class="float_content"> <div style="float: left"> {{ item.name }} </div> <div style="float: right; color: #8492a6; font-size: 13px"> {{ item.phone }} </div> <div style="clear: both;display: flex;justify-content: space-between;align-items:center"> <div> {{ item.region.province + item.region.city + item.region.region }} </div> <div style="margin-left:10px; color: #8492a6; font-size: 13px"> {{ item.detail }} </div> </div> </div> </el-option> </el-select>