一,tag 在input里面位置过高
对应ivu-tag ivu-tag-checked
<Select
@on-change="selectchange"
v-model="adddata.designee"
label-in-value
filter-by-label
:max-tag-count="0"
:max-tag-placeholder="maxTagPlaceholder"
multiple
clearable
filterable
class="searchSelect searchDisplay inlineStyle"
>
//内联样式.ivu-tag 是iview组件封装的 前面要添加父级的 myClass 此处为.inlineStyle
.inlineStyle .ivu-tag{
position: relative; /*定位 相对父级*/
top:1px;
}
二 css权重 !important;
//由于原样式是写在element上的,权重比class高,所以添加 !important;(注意有空格)
.inlineStyle .ivu-select-input{
width: 160px !important;
}
三 同级别class
同级别class
<div class="searchSelect searchDisplay inlineStyle ivu-select ivu-select-visible ivu-select-multiple ivu-select-default">
.selectDisplay .ivu-select-multiple{
width: 330px !important;
}
四 display
.selectBody{
display: flex;
justify-content: space-between;//让人员和已选人员 统一被大的div包裹
}
.selectdisplay {
width:340px !important;//
}
.selectDisplay .ivu-select-multiple{
width: 330px !important;//
}
.inlineStyle .ivu-select-selection{
width: 300px !important;//
}
.inlineStyle .ivu-select-input{
width: 160px !important; //搜索的placeholder
}
select 多选并显示选中的选项
//label-in-value: filter-by-label:
<Select
@on-change="selectchange"
v-model="adddata.designee"
label-in-value
filter-by-label
:max-tag-count="0"
:max-tag-placeholder="maxTagPlaceholder"
multiple
clearable
filterable
class="searchSelect searchDisplay inlineStyle"
>
<Option
v-for="item in userList"
:value="item.id"
:key="item.id"
:label="item.sectiontitle + '-' + item.name + '(' + item.work_code + ')'"
></Option
>
</Select>