Skip to content

Commit

Permalink
feat(validator): 优化提示文本
Browse files Browse the repository at this point in the history
  • Loading branch information
fjc0k committed Dec 24, 2020
1 parent d69393a commit 492c695
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/validator/locale/zhCN.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ export const zhCN: yup.Locale = {
string: {
length: ({ label, length }) =>
`${label || '此项'}必须仅包含${length}位字符`,
min: ({ label, min }) => `${label || '此项'}必须至少包含${min}位字符`,
max: ({ label, max }) => `${label || '此项'}必须最多包含${max}位字符`,
min: ({ label, min }) => `${label || '此项'}至少应包含${min}位字符`,
max: ({ label, max }) => `${label || '此项'}最多可包含${max}位字符`,
matches: ({ label, regex }) =>
`${label || '此项'}必须匹配该正则表达式: ${regex}`,
email: ({ label }) => `${label || '此项'}必须是一个合法的邮箱`,
Expand Down Expand Up @@ -63,7 +63,7 @@ export const zhCN: yup.Locale = {
`${label || '此项'}上有未定义的键: ${unknown}`,
},
array: {
min: ({ label, min }) => `${label || '此项'}必须至少包含${min}个元素`,
max: ({ label, max }) => `${label || '此项'}必须最多包含${max}个元素`,
min: ({ label, min }) => `${label || '此项'}至少应包含${min}个元素`,
max: ({ label, max }) => `${label || '此项'}最多可包含${max}个元素`,
},
}

0 comments on commit 492c695

Please sign in to comment.