Commit a9ac992e by Tianqing Liu

feat: 增加取消选中功能

1 parent cfe6a49b
...@@ -747,7 +747,13 @@ export default { ...@@ -747,7 +747,13 @@ export default {
console.log('handleClick', data, event) console.log('handleClick', data, event)
// 多选。只有设置为多选状态的组,才可以选中 // 多选。只有设置为多选状态的组,才可以选中
if (isMultipleOperation.value) { if (isMultipleOperation.value) {
selectedPersonList.value.push(data) // 如果已选中,则取消。若未选中,则增加
const isExist = selectedPersonList.value.find(item => item.id === data.id)
if (isExist) {
selectedPersonList.value = selectedPersonList.value.filter(item => item.id !== data.id)
} else {
selectedPersonList.value.push(data)
}
} else { } else {
currentItemId.value = data.id currentItemId.value = data.id
currobj.value = data; currobj.value = data;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!