123456789101112131415161718192021222324252627282930313233343536373839 |
- import Vue from 'vue';
- import VueMask from 'v-mask';
- Vue.use(VueMask);
- // 身份证
- const idCard = [...Array.from({ length: 17 }).fill(/\d/), /(\d|X|x)/];
- const phone = [/1/, ...Array.from({ length: 10 }).fill(/\d/)];
- const phoneKebab = [
- /1/,
- ...Array.from({ length: 2 }).fill(/\d/),
- '-',
- ...Array.from({ length: 4 }).fill(/\d/),
- '-',
- ...Array.from({ length: 4 }).fill(/\d/),
- ];
- const phoneNo = [
- /1/,
- ...Array.from({ length: 2 }).fill(/\d/),
- ' ',
- ...Array.from({ length: 4 }).fill(/\d/),
- ' ',
- ...Array.from({ length: 4 }).fill(/\d/),
- ];
- const bankCard = Array.from({ length: 20 }).fill(/\d/);
- export default function (c, i) {
- i('mask', {
- idCard,
- phone,
- bankCard,
- phoneKebab,
- phoneNo,
- });
- }
|