ElemeFE / ElemeFE/element-react
[Table]: fix filters bug
- Dominant language
- JavaScript
- Stars
- 2.8k
- Forks
- 435
- PR merge metrics
- No merged PRs in 30d
Description
### Description
版本: "element-react": "^1.4.34",
"element-theme-default": "^1.4.13",
element-react的Table组件中的filters属性中某一个value设置为false时filterMethod中的value值会获取成设置value为false的text值。
### Reproduce Steps
1. filters: [ { text: 'TEST', value: false }]
2. filterMethod(value, row) {
return row.Status == value
}
### Solution
Debug后发现问题所在在于FilterPannel.jsx中的CheckBoxGroup中出了问题:
73行中: onChange: this.onChange.bind(this, child.props.value ? child.props.value : child.props.value === 0 ? 0 : child.props.label
缺失一行value等于false的判断
修改为: onChange: this.onChange.bind(this, child.props.value ? child.props.value : child.props.value === 0 ? 0 : child.props.label || child.props.value === false ? false : child.props.label
Contributor guide
Assessment
This issue has not been assessed yet.