templete
<el-transfer
filterable
@left-check-change="leftCopeChane"
:titles="['菜品', '已选菜品']"
:filter-method="filterMethod"
v-model="value"
:props="{
key: 'id',
label: 'name'
}"
:data="dataList">
<span slot-scope="{option}">{{option.name}}
<span style="float: right;padding-right:10px;font-size: 10px;text-align: left">
{{option.typeName==null?'':';'+option.typeName}}
{{option.tasteName==null?'':';'+option.tasteName}}
{{option.feelName==null?'':';'+option.feelName}}
{{option.spicyName==null?'':';'+option.spicyName}}
</span>
</span>
</el-transfer>
method:
leftCopeChane(selecedOption) {
if (selecedOption.length > this.selecedOption.length) {
let selectValue = selecedOption.concat(this.selecedOption).filter(v => !selecedOption.includes(v) || !this.selecedOption.includes(v))
alert(selecedOption + ' ' + this.selecedOption + '选中' + selectValue);
}
this.selecedOption = selecedOption;
},
selectValue极为选中的值