{{ item.name }}
@@ -91,7 +91,7 @@
:disable-transitions="true"
:key="i"
closable
- @close="cancelSelect(item, i)">{{ item.name || item.userName }}
+ @close="cancelSelect(item, i)">{{ item.name || item.userName || item.realName }}
@@ -117,6 +117,10 @@ export default {
return []
}
},
+ keys: {
+ type: String,
+ default: 'id',
+ },
dialogTitle: String,
headerTitle: {
type: String,
@@ -218,7 +222,7 @@ export default {
this.selectPeople = []
}
- let index = this.selectPeople.findIndex(item => item.id === user.id)
+ let index = this.selectPeople.findIndex(item => item[this.keys] === user[this.keys])
if (index > -1) {
this.selectPeople.splice(index, 1)
@@ -244,7 +248,7 @@ export default {
},
getIsActive(id) {
- return this.selectPeople.findIndex(item => item.id === id) > -1
+ return this.selectPeople.findIndex(item => item[this.keys] === id) > -1
},
clearAll() {