Skip to content

Commit

Permalink
fix(@uform/validator): fix maximum rule get message logic (#468)
Browse files Browse the repository at this point in the history
* refactor(@uform/core): update onFormSubmit position

* fix(@uform/validator): fix rules
  • Loading branch information
janryWang authored Dec 6, 2019
1 parent b8467e2 commit 752c09e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/validator/src/rules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ export default {
return length > max ? getRuleMessage(rule, 'max') : ''
},
maximum(value: any, rule: ValidateDescription) {
return Number(value) > Number(rule.maximum) ? getMessage('maximum') : ''
return Number(value) > Number(rule.maximum)
? getRuleMessage(rule, 'maximum')
: ''
},
exclusiveMaximum(value: any, rule: ValidateDescription) {
return Number(value) >= Number(rule.maximum)
Expand Down

0 comments on commit 752c09e

Please sign in to comment.