mirror of
https://github.com/tenrok/vue-select.git
synced 2026-05-26 04:34:04 +03:00
multiple mode - add/remove support vuex strictmode (#702)
What --- - In multiple mode: Update adding or removing a value to use spread operator or filter, instead of mutating the array directly. Why --- So vuex strict mode doesn't throw warnings.
This commit is contained in:
@@ -844,7 +844,7 @@
|
||||
if (this.multiple && !this.mutableValue) {
|
||||
this.mutableValue = [option]
|
||||
} else if (this.multiple) {
|
||||
this.mutableValue.push(option)
|
||||
this.mutableValue = [...this.mutableValue, option]
|
||||
} else {
|
||||
this.mutableValue = option
|
||||
}
|
||||
@@ -867,8 +867,7 @@
|
||||
ref = val
|
||||
}
|
||||
})
|
||||
var index = this.mutableValue.indexOf(ref)
|
||||
this.mutableValue.splice(index, 1)
|
||||
this.mutableValue = this.mutableValue.filter(entry => entry !== ref)
|
||||
} else {
|
||||
this.mutableValue = null
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user