@@ -10,9 +10,6 @@ export default {
10
10
name : 'ACheckbox' ,
11
11
inheritAttrs : false ,
12
12
__ANT_CHECKBOX : true ,
13
- model : {
14
- prop : 'checked' ,
15
- } ,
16
13
props : {
17
14
prefixCls : PropTypes . string ,
18
15
defaultChecked : PropTypes . bool ,
@@ -45,6 +42,7 @@ export default {
45
42
} ) ;
46
43
} ,
47
44
} ,
45
+
48
46
mounted ( ) {
49
47
const { value, checkboxGroupContext : checkboxGroup = { } } = this ;
50
48
if ( checkboxGroup . registerValue ) {
@@ -84,7 +82,7 @@ export default {
84
82
const { indeterminate, prefixCls : customizePrefixCls , ...restProps } = props ;
85
83
const getPrefixCls = this . configProvider . getPrefixCls ;
86
84
const prefixCls = getPrefixCls ( 'checkbox' , customizePrefixCls ) ;
87
- const { onMouseenter, onMouseleave, onInput, ...restAttrs } = $attrs ;
85
+ const { onMouseenter, onMouseleave, onInput, class : className , style , ...restAttrs } = $attrs ;
88
86
const checkboxProps = {
89
87
...restProps ,
90
88
prefixCls,
@@ -102,16 +100,24 @@ export default {
102
100
} else {
103
101
checkboxProps . onChange = this . handleChange ;
104
102
}
105
- const classString = classNames ( {
106
- [ `${ prefixCls } -wrapper` ] : true ,
107
- [ `${ prefixCls } -wrapper-checked` ] : checkboxProps . checked ,
108
- [ `${ prefixCls } -wrapper-disabled` ] : checkboxProps . disabled ,
109
- } ) ;
103
+ const classString = classNames (
104
+ {
105
+ [ `${ prefixCls } -wrapper` ] : true ,
106
+ [ `${ prefixCls } -wrapper-checked` ] : checkboxProps . checked ,
107
+ [ `${ prefixCls } -wrapper-disabled` ] : checkboxProps . disabled ,
108
+ } ,
109
+ className ,
110
+ ) ;
110
111
const checkboxClass = classNames ( {
111
112
[ `${ prefixCls } -indeterminate` ] : indeterminate ,
112
113
} ) ;
113
114
return (
114
- < label class = { classString } onMouseenter = { onMouseenter } onMouseenter = { onMouseleave } >
115
+ < label
116
+ class = { classString }
117
+ style = { style }
118
+ onMouseenter = { onMouseenter }
119
+ onMouseenter = { onMouseleave }
120
+ >
115
121
< VcCheckbox { ...checkboxProps } class = { checkboxClass } ref = "vcCheckbox" />
116
122
{ children !== undefined && < span > { children } </ span > }
117
123
</ label >
0 commit comments