From 9022873a6f37b0c2ceddbab4f6a5576bf247034f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=97=AB=E6=99=93=E8=8C=B9?= <1935832701@qq.com> Date: Fri, 4 Aug 2023 15:24:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=BA=AB=E4=BB=BD=E8=AF=81?= =?UTF-8?q?=E5=8F=AA=E8=83=BD=E8=BE=93=E6=95=B0=E5=AD=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/add/add.vue | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pages/add/add.vue b/pages/add/add.vue index 1c0f762..2c5d653 100644 --- a/pages/add/add.vue +++ b/pages/add/add.vue @@ -37,7 +37,8 @@ - + @@ -181,6 +182,13 @@ }, methods: { + TypeInput(e, val) { + // 只能输入数字的验证; + var inputType = /[\W]/g ;//想限制什么类型在这里换换正则就可以了 + this.$nextTick(function() { + this.form.cardNumber = e.replace(inputType, ''); + }) + }, ontouchcancel() { uni.reLaunch({ url: "/pages/Personal/Personal"