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

40次阅读

共计 299 个字符,预计需要花费 1 分钟才能阅读完成。

        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",
        },

正文完
 0