From 2864a04f243c1e280ba40b08d163eef246a10937 Mon Sep 17 00:00:00 2001 From: "jqtmviyu@gmail.com" Date: Wed, 13 Jan 2021 16:57:34 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=86=E7=A0=81=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/login/index.vue | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/views/login/index.vue b/src/views/login/index.vue index bfb910b..a79d4c1 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -75,13 +75,13 @@ export default { callback(new Error('请输入合法手机号')) } } - const validatePassword = (rule, value, callback) => { - if (value.length < 6) { - callback(new Error('The password can not be less than 6 digits')) - } else { - callback() - } - } + // const validatePassword = (rule, value, callback) => { + // if (value.length < 6) { + // callback(new Error('The password can not be less than 6 digits')) + // } else { + // callback() + // } + // } return { loginForm: { mobile: '13800000002', @@ -94,7 +94,11 @@ export default { { required: true, trigger: 'blur', message: '手机号不能为空' }, { validator: validateUsername, trigger: 'blur' } ], - password: [{ required: true, trigger: 'blur', validator: validatePassword }] + // password: [{ required: true, trigger: 'blur', validator: validatePassword }] + password: [ + { required: true, trigger: 'blur', message: '密码不能为空' }, + { min: 6, max: 16, trigger: 'blur', message: '密码必须在6到16位之间' } + ] }, loading: false, passwordType: 'password',