前端类型判断工具类
1.是否邮箱 export const isEmail = (s) => { return /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+((.[a-zA-Z0-9_-]{2,3}){1,2})$/.test(s) } 2.是否手机号码 export const isMobile = (s) => { return /^1[0-9]{10}$/.test(s) } 3.是否电话号码 export const isPhone = (s) => { return /^([0-9]{3,4}-)?[0-9]{7,8}$/.test(s) } 4.是否url地 …