@@ -35,8 +35,8 @@ export function useCheckbox(props: CheckboxProps, ctx: SetupContext): UseCheckbo
3535 const mergedColor = computed ( ( ) => {
3636 return checkboxGroupConf ?. color . value ?? props . color ;
3737 } ) ;
38- const itemWidth = checkboxGroupConf ?. itemWidth . value ;
39- const direction = checkboxGroupConf ?. direction . value ;
38+ const itemWidth = checkboxGroupConf ?. itemWidth ;
39+ const direction = checkboxGroupConf ?. direction ;
4040
4141 const canChange = ( checked : boolean , val : string | undefined ) => {
4242 if ( mergedDisabled . value ) {
@@ -54,15 +54,14 @@ export function useCheckbox(props: CheckboxProps, ctx: SetupContext): UseCheckbo
5454 return Promise . resolve ( true ) ;
5555 } ;
5656 const toggle = ( ) => {
57- const current = ! isChecked . value ;
57+ const current = ! mergedChecked . value ;
5858 checkboxGroupConf ?. toggleGroupVal ( props . value ) ;
5959 ctx . emit ( 'update:checked' , current ) ;
6060 ctx . emit ( 'update:modelValue' , current ) ;
6161 ctx . emit ( 'change' , current ) ;
6262 } ;
63- const handleClick = ( $event : Event ) => {
64- $event . stopPropagation ( ) ;
65- canChange ( ! isChecked . value , props . label ) . then ( ( res ) => res && toggle ( ) ) ;
63+ const handleClick = ( ) => {
64+ canChange ( ! mergedChecked . value , props . label ) . then ( ( res ) => res && toggle ( ) ) ;
6665 } ;
6766
6867 const size = computed ( ( ) => props . size || checkboxGroupConf ?. size . value || formContext ?. size || 'md' ) ;
@@ -72,7 +71,7 @@ export function useCheckbox(props: CheckboxProps, ctx: SetupContext): UseCheckbo
7271 watch (
7372 ( ) => props . modelValue ,
7473 ( ) => {
75- formItemContext ?. validate ( 'change' ) . catch ( ( err ) => console . warn ( err ) ) ;
74+ formItemContext ?. validate ( 'change' ) . catch ( ( ) => { } ) ;
7675 }
7776 ) ;
7877 return {
@@ -138,7 +137,7 @@ export function useCheckboxGroup(props: CheckboxGroupProps, ctx: SetupContext):
138137 watch (
139138 ( ) => props . modelValue ,
140139 ( ) => {
141- formItemContext ?. validate ( 'change' ) . catch ( ( err ) => console . warn ( err ) ) ;
140+ formItemContext ?. validate ( 'change' ) . catch ( ( ) => { } ) ;
142141 } ,
143142 { deep : true }
144143 ) ;
0 commit comments