From 9ec2eea768eaebcce883d1ca39061224fe3987c2 Mon Sep 17 00:00:00 2001 From: Cloud Date: Sat, 25 Nov 2023 17:01:01 +0800 Subject: [PATCH] =?UTF-8?q?fix(demo):=20=E8=A1=A8=E5=8D=95=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E6=AD=A3=E5=88=99=E8=A1=A8=E8=BE=BE=E5=BC=8F=E9=AA=8C?= =?UTF-8?q?=E8=AF=81=E7=A4=BA=E4=BE=8B=E4=B8=8E=E5=AE=9E=E9=99=85=E8=AF=B4?= =?UTF-8?q?=E6=98=8E=E4=B8=8D=E7=AC=A6=20(#687)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/react-vant/src/components/form/demo/rules.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/react-vant/src/components/form/demo/rules.tsx b/packages/react-vant/src/components/form/demo/rules.tsx index cc9e0c43a..11f9efabf 100644 --- a/packages/react-vant/src/components/form/demo/rules.tsx +++ b/packages/react-vant/src/components/form/demo/rules.tsx @@ -20,7 +20,7 @@ export default () => { @@ -30,7 +30,7 @@ export default () => { rules={[ { validator: (_, value) => { - if (/1\d{10}/.test(value)) { + if (/^1\d{10}$/.test(value)) { return Promise.resolve(true) } return Promise.reject(new Error('请输入正确的手机号码')) @@ -50,7 +50,7 @@ export default () => { Toast.loading('验证中...') setTimeout(() => { - if (/\d{6}/.test(value)) { + if (/^\d{6}$/.test(value)) { resolve(true) } else { reject(new Error('请输入正确内容'))