el-select
多选、可搜索时,自动换行撑开页面如何解决?
在可搜索状态下,多选后确保内容不会换行
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
<script src="https://unpkg.com/vue@3"></script>
<link rel="stylesheet" href="https://unpkg.com/element-plus/dist/index.css">
<script src="https://unpkg.com/element-plus"></script>
<title>Element Plus demo</title>
</head>
<body>
<div id="app">
<el-select style="width: 150px;" class="my-select"
v-model="tv"
filterable
collapse-tags
collapse-tags-tooltip
multiple
placeholder="输入关键字进行搜索"
>
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</div>
<script>
const App = {
data() {
return {
tv:'',
message: "Hello Element Plus",
options : [
{
value: 'Option1',
label: 'Option11111111111111111111',
},
{
value: 'Option2',
label: 'Option2222222222222222222',
},
{
value: 'Option3',
label: 'Option333333333333333333333',
},
{
value: 'Option4',
label: 'Option4444444444444444',
},
{
value: 'Option5',
label: 'Option5',
},
]
};
},
};
const app = Vue.createApp(App);
app.use(ElementPlus);
app.mount("#app");
</script>
</style>
</body>
</html>
重构select的样式吧,element的之前写过一个,你参考一下