fix 修复问题

This commit is contained in:
2021-06-15 15:14:21 +08:00
parent 8ddee469e0
commit 5954d4f5e6
3 changed files with 28 additions and 13 deletions

View File

@@ -7,12 +7,14 @@ export default class QueryTableActions extends Component {
const { children } = this.props
const actions = []
Array.isArray(children) ? children.forEach((action, i) => {
actions.push(action)
if (i < this.props.children.length - 1) {
actions.push(<Divider type="vertical" key={i} />)
}
}) : (actions.push(children))
Array.isArray(children) ? children
.filter(action => action)
.forEach((action, i) => {
actions.push(action)
if (i < this.props.children.length - 1) {
actions.push(<Divider type="vertical" key={i} />)
}
}) : (actions.push(children))
return actions
}