乐趣区

关于javascript:常用表单验证规则

        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",
        },
退出移动版