From dc0f0b967c45f0eeef7479f2e04ea161122d2760 Mon Sep 17 00:00:00 2001 From: tjz <415800467@qq.com> Date: Fri, 8 Jun 2018 18:50:18 +0800 Subject: [PATCH] fix: table check --- components/table/SelectionBox.jsx | 8 ++++---- components/table/interface.js | 2 ++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/components/table/SelectionBox.jsx b/components/table/SelectionBox.jsx index b29b85baf..df05281a8 100644 --- a/components/table/SelectionBox.jsx +++ b/components/table/SelectionBox.jsx @@ -11,7 +11,7 @@ export default { props: SelectionBoxProps, data () { return { - checked: this.getCheckState(this.$props), + sChecked: this.getCheckState(this.$props), } }, @@ -28,8 +28,8 @@ export default { subscribe () { const { store } = this this.unsubscribe = store.subscribe(() => { - const checked = this.getCheckState(this.$props) - this.setState({ checked }) + const sChecked = this.getCheckState(this.$props) + this.setState({ sChecked }) }) }, @@ -48,7 +48,7 @@ export default { render () { const { type, rowIndex, ...rest } = getOptionProps(this) - const { checked, $attrs, $listeners } = this + const { sChecked: checked, $attrs, $listeners } = this const checkboxProps = { props: { checked, diff --git a/components/table/interface.js b/components/table/interface.js index 2457ca4ac..58935b5a9 100644 --- a/components/table/interface.js +++ b/components/table/interface.js @@ -174,6 +174,8 @@ export const SelectionBoxProps = { name: PropTypes.string, disabled: PropTypes.bool, id: PropTypes.string, + defaultChecked: PropTypes.bool, + checked: PropTypes.bool, // onChange: React.ChangeEventHandler; }