File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
packages/runtime-dom/src/directives Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -160,7 +160,7 @@ export const vModelCheckbox: ModelDirective<HTMLInputElement> = {
160
160
161
161
function setChecked (
162
162
el : HTMLInputElement ,
163
- { value } : DirectiveBinding ,
163
+ { value, oldValue } : DirectiveBinding ,
164
164
vnode : VNode ,
165
165
) {
166
166
// store the v-model value on the element so it can be accessed by the
@@ -173,7 +173,10 @@ function setChecked(
173
173
} else if ( isSet ( value ) ) {
174
174
checked = value . has ( vnode . props ! . value )
175
175
} else {
176
- checked = looseEqual ( value , getCheckboxValue ( el , true ) )
176
+ checked =
177
+ value === oldValue
178
+ ? el . checked
179
+ : looseEqual ( value , getCheckboxValue ( el , true ) )
177
180
}
178
181
179
182
// Only update if the checked state has changed
You can’t perform that action at this time.
0 commit comments