常用表单验证规则

        username: [
          {
            required: true,
            message: "请输入正确姓名",
            trigger: "blur",
            pattern: /^[\u4E00-\u9FA5a-zA-Z]{2,20}$/,
          },
        ],
        mobile: {
          required: true,
          pattern: /^1\d{10}$/,
          message: "请输入正确的手机号",
          trigger: "blur",
        },
        email: {
          required: true,
          pattern: /^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/,
          message: "请输入正确的邮箱",
          trigger: "blur",
        },

你可能感兴趣的:(javascript前端)