当前位置:网站首页>【增加功能】select下拉多选 显示选中的人员
【增加功能】select下拉多选 显示选中的人员
2022-06-11 12:27:00 【是炎炎哦(谁的小马甲)】
- 需求:显示选中的人员
//html
<div class="formItem">
<label>{
{
$t("100046") }}:</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"
>
<Option
style="width:240px"
v-for="item in userList"
:value="item.id"
:key="item.id"
:label="item.sectiontitle + '-' + item.name + '(' + item.work_code + ')'"
></Option
>
</Select>
</div>
<br>
//显示选中的人员
<div class="selectPart">
<label>
已选人员:
</label>
<div class="selectPersons">
<div class="ivu-tag ivu-tag-checked"
style=""
v-for=" (item,index) in selectionList"
:key="index">
<span>{
{
item.label}}</span>
<i @click="del(item.value)"
class="ivu-icon ivu-icon-ios-close"></i>
</div>
</div>
</div>
//js
methods: {
//选中人员传入this.selectionList
selectchange (value) {
console.log(value)
this.selectionList = value
},
//在显示人员页面,删除选中人员
del(val){
console.log(this.selectionList);
//在传入的所有数据数组 对删除的数据进行过滤
let {
designee} = this.adddata;
designee = designee.filter(item=>item!=val)
this.adddata={
...this.adddata,
designee,
}
//选中的数据数组里对删除的数据进行过滤
this.selectionList = this.selectionList.filter(item=>{
item.value!=val
})
},
}
//解决label与span不对齐 .selectPart{
display:flex;
align-items:center ;
}
.selectPersons {
width: 300px;
height: 60px !important;
font-size: 12px;
display: inline-block;
overflow-y: auto;
/* margin-top: -20px; margin-bottom: -20px; */
}
边栏推荐
- Usage of instr function in Oracle Database
- Meichuang technology data security management platform won the "leading scientific and Technological Achievement Award" of 2022 digital Expo
- Jerry's aicmd_ SET_ BT_ Addr command format [chapter]
- Where is it safer to open an account for soda ash futures? How much is the margin for soda ash futures?
- 知物由学 | 行为时序建模在社交引流黑产识别中的应用
- 经营体育馆有哪些要素?
- 7、CAS
- How can I use a domain name to access a website?
- How can non-standard automation equipment manufacturing enterprises achieve rapid and accurate quotation with the help of ERP system?
- Redis data type Daily use Scenarios
猜你喜欢

美容院管理系统如何解决门店运营的三大难题?

Mctalk's entrepreneurial voice - erudition and discernment: be interested in socializing, and provide a "small and beautiful" space for old friends before and after retirement

. 4 literal and variable

(recommended) how many splunks are appropriate? Search head

Wireshark packet capturing and debugging RTSP

How to optimize SEO on the mobile terminal? Do you need to optimize GoogleSEO on the mobile terminal for a separate m domain name?

oracle数据库导入数据步骤

openharmony标准系统之app手动签名

Flick grouping sets multidimensional aggregation and setting table state expiration time

9. Parler de threadlocal
随机推荐
Jerry's aicmd_ SET_ BT_ Addr command format [chapter]
Meichuang technology data security management platform won the "leading scientific and Technological Achievement Award" of 2022 digital Expo
Where is it safer to open an account for soda ash futures? How much is the margin for soda ash futures?
Ettercap sniffing of man in the middle attack
Zhongfu Jinshi: with the rapid development of the intelligent bathroom industry, the intelligent toilet will usher in a highlight moment
Construction of specflow environment
2022 vmvare download and installation tutorial on the latest official website (ultra detailed)
Jerry's aicmd command [chapter]
Flick grouping sets multidimensional aggregation and setting table state expiration time
Redis數據類型日常使用場景
App manual signature of openharmony standard system
换种方式实现阖家团圆,2022旗舰投影坚果J10S被种草
Problems encountered recently when using nodejs Pinyin package
openharmony标准系统移植之音频适配
2、CompletableFuture
Record a CODIS memory cleanup
CMD of Jerry's AI protocol_ SET_ BT_ Name [chapter]
What are the advantages of comprehensive venues?
Flip window join, interval join, window cogroup
14. Course summary and review