From 87216c5527058a8c5028c0415210370d28918b0c Mon Sep 17 00:00:00 2001 From: tjz <415800467@qq.com> Date: Sat, 5 May 2018 17:39:56 +0800 Subject: [PATCH] fix: checkbox type --- components/checkbox/Checkbox.jsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/components/checkbox/Checkbox.jsx b/components/checkbox/Checkbox.jsx index af96818ae..d206518dc 100644 --- a/components/checkbox/Checkbox.jsx +++ b/components/checkbox/Checkbox.jsx @@ -1,5 +1,6 @@ import hasProp from '../_util/props-util' +import PropTypes from '../_util/vue-types' export default { name: 'ACheckbox', props: { @@ -14,6 +15,7 @@ export default { value: [String, Number, Boolean], name: String, indeterminate: Boolean, + type: PropTypes.string.def('checkbox'), }, model: { prop: 'checked', @@ -52,14 +54,14 @@ export default { handleChange (event) { const targetChecked = event.target.checked this.$emit('input', targetChecked) - const { name, value, checked, checkboxGroupContext, sChecked } = this + const { name, value, checked, checkboxGroupContext } = this if ((checked === undefined && !checkboxGroupContext) || (checkboxGroupContext && checkboxGroupContext.sValue === undefined)) { this.sChecked = targetChecked } const target = { name, value, - checked: !sChecked, + checked: targetChecked, } this.$emit('change', { target,