Revert "fix(v-model): mutate original array for v-model multi checkbox (#2663)"
This reverts commit 87581cd266.
ref: #2700
This commit is contained in:
@@ -111,9 +111,11 @@ export const vModelCheckbox: ModelDirective<HTMLInputElement> = {
|
||||
const index = looseIndexOf(modelValue, elementValue)
|
||||
const found = index !== -1
|
||||
if (checked && !found) {
|
||||
modelValue.push(elementValue)
|
||||
assign(modelValue.concat(elementValue))
|
||||
} else if (!checked && found) {
|
||||
modelValue.splice(index, 1)
|
||||
const filtered = [...modelValue]
|
||||
filtered.splice(index, 1)
|
||||
assign(filtered)
|
||||
}
|
||||
} else if (isSet(modelValue)) {
|
||||
if (checked) {
|
||||
|
||||
Reference in New Issue
Block a user