@@ -15,6 +15,7 @@ import warning from '../_util/warning';
15
15
import type { EventHandler } from '../_util/EventInterface' ;
16
16
import { FormItemInputContext , useInjectFormItemContext } from '../form/FormItemContext' ;
17
17
import useConfigInject from '../config-provider/hooks/useConfigInject' ;
18
+ import { useInjectDisabled } from '../config-provider/DisabledContext' ;
18
19
19
20
import type { CheckboxChangeEvent , CheckboxProps } from './interface' ;
20
21
import { CheckboxGroupContextKey , checkboxProps } from './interface' ;
@@ -33,6 +34,8 @@ export default defineComponent({
33
34
const formItemContext = useInjectFormItemContext ( ) ;
34
35
const formItemInputContext = FormItemInputContext . useInject ( ) ;
35
36
const { prefixCls, direction, disabled } = useConfigInject ( 'checkbox' , props ) ;
37
+
38
+ const contextDisabled = useInjectDisabled ( ) ;
36
39
// style
37
40
const [ wrapSSR , hashId ] = useStyle ( prefixCls ) ;
38
41
@@ -94,7 +97,7 @@ export default defineComponent({
94
97
} ;
95
98
checkboxProps . name = checkboxGroup . name . value ;
96
99
checkboxProps . checked = checkboxGroup . mergedValue . value . includes ( props . value ) ;
97
- checkboxProps . disabled = mergedDisabled . value || checkboxGroup . disabled . value ;
100
+ checkboxProps . disabled = mergedDisabled . value || contextDisabled . value ;
98
101
checkboxProps . indeterminate = indeterminate ;
99
102
} else {
100
103
checkboxProps . onChange = handleChange ;
@@ -129,7 +132,6 @@ export default defineComponent({
129
132
{ ...checkboxProps }
130
133
class = { checkboxClass }
131
134
ref = { checkboxRef }
132
- disabled = { mergedDisabled . value }
133
135
/>
134
136
{ children . length ? < span > { children } </ span > : null }
135
137
</ label > ,
0 commit comments