Element-UI-穿梭框(Transfer)
需要获得选中的那项详情,一共有俩个办法:
第一种方法:
<el-transfer
v-model="quesValues"
:titles="['待选试题', '已选试题']"
:format="{
noChecked: '${total}',
hasChecked: '${checked}/${total}'
}"
:data="quesData">
<div slot-scope="{ option }">
<span @click="checkBtn(option)">查看</span>
<span> {{ option.label }}-{{ option.phone }}</span>
</div>
</el-transfer>
第二种方法:
<el-transfer style="text-align: left; display: inline-block;margin-top: 20px;" v-model="quesValues"
:titles="['待选试题', '已选试题']" :render-content="renderFunc" :format="{
noChecked: '${total}',
hasChecked: '${checked}/${total}'
}"
:data="quesData">
</el-transfer>
renderFunc(h, option) {
return h('span', {
domProps: {
title: option.flag
}
}, option.flag);
},