Skip to content

Commit

Permalink
fix(grid): [grid] validate successful add return value in promise sen…
Browse files Browse the repository at this point in the history
…se (#2851)
  • Loading branch information
gimmyhehe authored Feb 5, 2025
1 parent 65c404b commit 192bce0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 13 deletions.
14 changes: 1 addition & 13 deletions examples/sites/demos/apis/grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -2490,24 +2490,12 @@ export default {
defaultValue: '',
desc: {
'zh-CN':
'表格校验函数,如果指定 row 或 rows 则校验指定一行或多行,否则校验整个表格。该回调函数会在校验结束后被调用,并传入两个参数:(是否校验成功,最近一列未通过校验的字段)。若不传入回调函数,则会返回一个 promise',
'表格校验函数,如果指定 row 或 rows 则校验指定一行或多行,否则校验整个表格。该回调函数会在校验结束后被调用,并传入两个参数:(是否校验成功,最近一列未通过校验的字段)。若不传入回调函数,则会返回一个 promise, 校验成功返回 true (3.22.0新增),校验失败返回错误信息对象',
'en-US':
'Table verification function. If a row or rows is specified, the specified row or multiple rows are verified. Otherwise, the entire table is verified. This callback function is called after the verification is complete and the following parameters are transferred: (Whether the verification is successful. The fields in the latest column fail the verification.) If no callback function is passed in, a promise is returned'
},
mode: ['pc', 'mobile-first'],
pcDemo: 'grid-validation#validation-before-submit-validation'
},
{
name: 'validate(rows, callback)',
type: '',
defaultValue: '',
desc: {
'zh-CN':
'表格校验函数,如果指定 row 或 rows 则校验指定一行或多行,否则校验整个表格。该回调函数会在校验结束后被调用,并传入两个参数:(是否校验成功,最近一列未通过校验的字段)。若不传入回调函数,则会返回一个 promise',
'en-US': ''
},
mode: ['mobile-first'],
mfDemo: ''
}
],
slots: [
Expand Down
1 change: 1 addition & 0 deletions packages/vue/src/grid/src/validator/src/methods.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ export default {
}

cb && cb(opt.status)
return opt.status
}
return Promise.all(rowValids).then(onFulfilled).catch(onRejected(opt, this))
},
Expand Down

0 comments on commit 192bce0

Please sign in to comment.