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"