File tree 1 file changed +6
-5
lines changed
components/vc-checkbox/src
1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -69,11 +69,6 @@ export default defineComponent({
69
69
if ( ! ( 'checked' in props ) ) {
70
70
this . sChecked = e . target . checked ;
71
71
}
72
- // fix https://github.com/vueComponent/ant-design-vue/issues/3047
73
- if ( 'checked' in props ) {
74
- this . $refs . input . checked = props . checked ;
75
- }
76
- this . $forceUpdate ( ) ; // change前,维持现有状态
77
72
e . shiftKey = this . eventShiftKey ;
78
73
const eventObj = {
79
74
target : {
@@ -88,6 +83,12 @@ export default defineComponent({
88
83
} ,
89
84
nativeEvent : e ,
90
85
} ;
86
+
87
+ // fix https://github.com/vueComponent/ant-design-vue/issues/3047
88
+ // 受控模式下维持现有状态
89
+ if ( 'checked' in props ) {
90
+ this . $refs . input . checked = props . checked ;
91
+ }
91
92
this . __emit ( 'update:checked' , eventObj ) ;
92
93
this . __emit ( 'change' , eventObj ) ;
93
94
this . eventShiftKey = false ;
You can’t perform that action at this time.
0 commit comments