目录
- [一、 出现场景](#一、 出现场景)
- [二、 解决方案](#二、 解决方案)
一、 出现场景
在使用el-select
增加multiple
属性进行多选时,会出现高度塌陷的情况
二、 解决方案
首先需要在el-select
中增加collapse-tags
属性,并在style
中增加如下样式
方案一
html
<style scoped>
::v-deep .el-select .el-tag {
width: 60px;
}
::v-deep .el-select .el-tag:last-child {
width: auto !important;
}
</style>
方案2
html
<style scoped>
::v-deep .el-select__tags-text {
max-width: 60px !important;
}
</style>