Skip to content

Commit 6243e1d

Browse files
committed
fix: checkbox type
1 parent e477f52 commit 6243e1d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

components/checkbox/Checkbox.jsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11

22
import hasProp from '../_util/props-util'
3+
import PropTypes from '../_util/vue-types'
34
export default {
45
name: 'ACheckbox',
56
props: {
@@ -14,6 +15,7 @@ export default {
1415
value: [String, Number, Boolean],
1516
name: String,
1617
indeterminate: Boolean,
18+
type: PropTypes.string.def('checkbox'),
1719
},
1820
model: {
1921
prop: 'checked',
@@ -52,14 +54,14 @@ export default {
5254
handleChange (event) {
5355
const targetChecked = event.target.checked
5456
this.$emit('input', targetChecked)
55-
const { name, value, checked, checkboxGroupContext, sChecked } = this
57+
const { name, value, checked, checkboxGroupContext } = this
5658
if ((checked === undefined && !checkboxGroupContext) || (checkboxGroupContext && checkboxGroupContext.sValue === undefined)) {
5759
this.sChecked = targetChecked
5860
}
5961
const target = {
6062
name,
6163
value,
62-
checked: !sChecked,
64+
checked: targetChecked,
6365
}
6466
this.$emit('change', {
6567
target,

0 commit comments

Comments
 (0)