]> git.ipfire.org Git - thirdparty/vuejs/core.git/commit
fix(v-model): mutate original array for v-model multi checkbox (#2663)
authorHcySunYang <HcySunYang@outlook.com>
Mon, 30 Nov 2020 22:48:51 +0000 (06:48 +0800)
committerGitHub <noreply@github.com>
Mon, 30 Nov 2020 22:48:51 +0000 (17:48 -0500)
commit87581cd2662d6db21b35db7a0b5df2090c8a7fe2
treee89983b72cfec486c2cd09d7401f1970e35b96f1
parentcd928362232747a51d1fd4790bb20adcdd59d187
fix(v-model): mutate original array for v-model multi checkbox (#2663)

Note: this change will break non-deep `watch` on the `v-model` bound array since the array is no longer replaced. This can be considered part of the Array watch changes in v3 as detailed at https://v3.vuejs.org/guide/migration/watch.html

This is unfortunate but unavoidable since the issue that it fixes is more important: `v-model` should definitely work with a non-ref reactive array.

fix #2662
packages/runtime-dom/__tests__/directives/vModel.spec.ts
packages/runtime-dom/src/directives/vModel.ts