Skip to content

Commit

Permalink
fix(@uform/core): Optimize the 'errors' information structure
Browse files Browse the repository at this point in the history
  • Loading branch information
janryWang committed May 6, 2019
1 parent 0baabb7 commit be680e0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions docs/API/Submit.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { Submit } from '@uform/next(antd)'
扩展属性

- showLoading : Boolean

> 主要用于控制Submit组件是否自动展示loading图标,要求SchemaForm的onSubmit回调必须返回Promise对象才会生效。
## 用例
Expand Down
5 changes: 3 additions & 2 deletions packages/core/src/form.js
Original file line number Diff line number Diff line change
Expand Up @@ -294,8 +294,9 @@ export class Form {
const lastValid = this.state.valid
let _errors = reduce(
response,
(buf, { valid, errors }) => {
return buf.concat(errors)
(buf, { name, errors }) => {
if (!errors.length) return buf
return buf.concat({ name, errors })
},
[]
)
Expand Down

0 comments on commit be680e0

Please sign in to comment.