fix: table check

pull/77/merge
tjz 2018-06-08 18:50:18 +08:00
parent acd7a96f68
commit dc0f0b967c
2 changed files with 6 additions and 4 deletions

View File

@ -11,7 +11,7 @@ export default {
props: SelectionBoxProps, props: SelectionBoxProps,
data () { data () {
return { return {
checked: this.getCheckState(this.$props), sChecked: this.getCheckState(this.$props),
} }
}, },
@ -28,8 +28,8 @@ export default {
subscribe () { subscribe () {
const { store } = this const { store } = this
this.unsubscribe = store.subscribe(() => { this.unsubscribe = store.subscribe(() => {
const checked = this.getCheckState(this.$props) const sChecked = this.getCheckState(this.$props)
this.setState({ checked }) this.setState({ sChecked })
}) })
}, },
@ -48,7 +48,7 @@ export default {
render () { render () {
const { type, rowIndex, ...rest } = getOptionProps(this) const { type, rowIndex, ...rest } = getOptionProps(this)
const { checked, $attrs, $listeners } = this const { sChecked: checked, $attrs, $listeners } = this
const checkboxProps = { const checkboxProps = {
props: { props: {
checked, checked,

View File

@ -174,6 +174,8 @@ export const SelectionBoxProps = {
name: PropTypes.string, name: PropTypes.string,
disabled: PropTypes.bool, disabled: PropTypes.bool,
id: PropTypes.string, id: PropTypes.string,
defaultChecked: PropTypes.bool,
checked: PropTypes.bool,
// onChange: React.ChangeEventHandler<HTMLInputElement>; // onChange: React.ChangeEventHandler<HTMLInputElement>;
} }