<el-form-item label="角色:" prop="username">
<el-select
v-model="value"
placeholder="Select"
popper-class="role_select"
>
<el-option disabled>
<div class="flex">
<div style="width: 150px">
角色
</div>
<div>特权</div>
</div>
</el-option>
<el-option
v-for="item in roleList"
:key="item.roleid"
:label="item.roleid"
:value="item.roleid"
>
<div class="flex">
<div style="width: 150px">
{{ item.roleid }}
</div>
<el-space
wrap
style="
width: 500px;
white-space: normal;
word-wrap: break-word;
"
>
<el-tag
v-for="item1 in item.privs"
:key="item1"
plain
type="primary"
size="small"
>
{{ item1 }}
</el-tag>
</el-space>
</div>
</el-option>
</el-select>
</el-form-item>```
css部分:
不加scoped
<style lang="scss">
.role_select {
height: unset !important;
.el-select-dropdown__item {
height: unset;
line-height: unset;
border-bottom: 1px solid
padding: 5px 30px 5px;
}
}
</style>