Skip to content

Commit

Permalink
表单校验不完善
Browse files Browse the repository at this point in the history
  • Loading branch information
John-Chan committed May 23, 2020
1 parent 0d69c63 commit 2385ec8
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
13 changes: 12 additions & 1 deletion src/const/crud/admin/role.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,18 @@ export const tableOption = {
label: '角色描述',
prop: 'roleDesc',
overHidden: true,
span: 24
span: 24,
rules: [{
required: true,
message: '角色描述不能为空',
trigger: 'blur'
},
{
min: 3,
max: 100,
message: '长度在 3 到 100 个字符',
trigger: 'blur'
}]
}, {
label: '创建时间',
prop: 'createTime',
Expand Down
13 changes: 12 additions & 1 deletion src/const/crud/admin/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ export const tableOption = {
hide: true,
span: 24,
rules: [{
required: true,
message: '密码不能为空',
trigger: 'blur'
},{
min: 6,
max: 20,
message: '长度在 6 到 20 个字符',
Expand All @@ -112,7 +116,14 @@ export const tableOption = {
type: 'phone',
value: '',
span: 24,
rules: [ {validator: checkPhone, trigger: 'blur' }]
rules: [ {
required: true,
message: '密码不能为空',
trigger: 'blur'
},{
validator: checkPhone,
trigger: 'blur'
}]
}, {
label: '角色',
prop: 'role',
Expand Down

0 comments on commit 2385ec8

Please sign in to comment.