We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dc91310 commit f95b118Copy full SHA for f95b118
src/components/Select.vue
@@ -555,14 +555,9 @@
555
*/
556
deselect(option) {
557
if (this.multiple) {
558
- let ref = -1
559
- this.mutableValue.forEach((val) => {
560
- if (val === option || (this.index && val === option[this.index]) || (typeof val === 'object' && val[this.label] === option[this.label])) {
561
- ref = val
562
- }
563
- })
564
- var index = this.mutableValue.indexOf(ref)
565
- this.mutableValue.splice(index, 1)
+ this.mutableValue = this.mutableValue.filter(val => {
+ return ! (val === option || (this.index && val === option[this.index]) || (typeof val === 'object' && val[this.label] === option[this.label]));
+ });
566
} else {
567
this.mutableValue = null
568
}
0 commit comments