// 邮箱 const isEmail = (value) => {return /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+((.[a-zA-Z0-9_-]{2,3}){1,2})$/.test(s) }// 手机号码 const isMobile = (value) => {return /^1[0-9]{10}$/.test(value) }// 电话号码 const isPhone = (value) => {return /^([0-9]{3,4}-)?[0-9]{7,8}$/.test(value) }// 网址 const isURL = (value) => {return /^((http|https):\/\/)?[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@?^=%&:/~\+#]*[\w\-\@?^=...
/*** 邮箱* @param {*} s*/ export function isEmail (s) {return /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+((.[a-zA-Z0-9_-]{2,3}){1,2})$/.test(s) }/*** 手机号码* @param {*} s*/ export function isMobile (s) {return /^1[0-9]{10}$/.test(s) }/*** 电话号码* @param {*} s*/ export function isPhone (s) {return /^([0-9]{3,4}-)?[0-9]{7,8}$/.test(s) }/*** URL地址* @param {*} s*/ export function isURL (s) {return /^htt...
changeInt(msg) {// 判断是否为颜色的16进制console.log(msg);var reg = /^#([0-9a-fA-F]{6}|[0-9a-fA-F]{3})$/;console.log(reg.test(msg)); },<input type="number" v-model="amount" @input="changeInt(color)">