el-select下拉框 宽度自定义
- 场景:因下拉项字数太多,会撑开下拉框宽度
- 解决办法:添加
popper-class
设置width: 0
并给el-option
添加title
属性
<el-select
v-model="form.caseId"
popper-class="test-case-select-option"
>
<el-option
v-for="item in options"
:key="item.id"
:title="item.code"
:label="item.code"
:value="item.id"
/>
</el-select>
.test-case-select-option {
width: 0
}