Skip to content

Commit

Permalink
fix: upload children (#631)
Browse files Browse the repository at this point in the history
  • Loading branch information
JeromeYangtao authored and janryWang committed Jan 28, 2020
1 parent 46249fd commit 9c0095c
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions packages/next/src/fields/upload.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,14 @@ registerFormField(
}

render() {
const { listType, locale, onChange, value, ...others } = this.props
const {
listType,
locale,
onChange,
value,
children,
...others
} = this.props

if (listType.indexOf('card') > -1) {
return (
Expand Down Expand Up @@ -193,9 +200,13 @@ registerFormField(
onChange={this.onChangeHandler}
listType={listType}
>
<Button style={{ margin: '0 0 10px' }}>
{(locale && locale.uploadText) || '上传文件'}
</Button>
{children ? (
children
) : (
<Button style={{ margin: '0 0 10px' }}>
{(locale && locale.uploadText) || '上传文件'}
</Button>
)}
</Upload>
)
}
Expand Down

0 comments on commit 9c0095c

Please sign in to comment.