|
@@ -3,23 +3,11 @@ import VueMask from 'v-mask';
|
|
|
Vue.use(VueMask);
|
|
|
|
|
|
// 身份证
|
|
|
-const idCard = (value) => {
|
|
|
- // 前17位数字
|
|
|
- const mask = Array.from({ length: 17 }).fill(/\d/);
|
|
|
- // 最后一位数字或X
|
|
|
- mask.push(/(\d|X|x)/);
|
|
|
- return mask;
|
|
|
-};
|
|
|
+const idCard = [...Array.from({ length: 17 }).fill(/\d/), /(\d|X|x)/];
|
|
|
|
|
|
-const phone = (value) => {
|
|
|
- const mask = [/1/, ...Array.from({ length: 10 }).fill(/\d/)];
|
|
|
- return mask;
|
|
|
-};
|
|
|
+const phone = [/1/, ...Array.from({ length: 10 }).fill(/\d/)];
|
|
|
|
|
|
-const bankCard = (value) => {
|
|
|
- const mask = Array.from({ length: 20 }).fill(/\d/);
|
|
|
- return mask;
|
|
|
-};
|
|
|
+const bankCard = Array.from({ length: 20 }).fill(/\d/);
|
|
|
|
|
|
export default function (c, i) {
|
|
|
i('mask', {
|