Skip to content

Commit

Permalink
Merge pull request dvajs#200 from jerexyz/master
Browse files Browse the repository at this point in the history
fix user-dashboard edit age  bug
  • Loading branch information
nikogu authored Oct 26, 2016
2 parents 585fd8c + 9e54fde commit 7e52e1b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion examples/user-dashboard/src/components/Users/UserModal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ const UserModal = ({
}

function checkNumber(rule, value, callback) {
if (!value) {
callback(new Error('年龄未填写'));
}
if (!/^[\d]{1,2}$/.test(value)) {
callback(new Error('年龄不合法'));
} else {
Expand Down Expand Up @@ -72,7 +75,6 @@ const UserModal = ({
{getFieldDecorator('age', {
initialValue: item.age,
rules: [
{ required: true, message: '年龄未填写' },
{ validator: checkNumber },
],
})(
Expand Down

0 comments on commit 7e52e1b

Please sign in to comment.