正则验证
wei佳
这个作者很懒,什么都没留下…
展开
-
VUE输入 身份证 号,获取出生年月日
获取方式 handleIdCard(val) { // this.rowData.dateOfBirth = this.getBirthdayFromIdCard(val) if (val) { this.rowData.dateOfBirth = dateFormat(this.getBirthdayFromIdCard(val), 'yyyy-MM-dd hh:mm:ss') } else { this.rowData.dateOfB原创 2022-01-17 12:15:56 · 2283 阅读 · 0 评论 -
vue表格分页勾选状态保留
/** 解决当前页面搜索后依然保持表格多选状态 * currentPageData 当前页所有数据 * currentPageSelected 当前页已选数据 * currentPageNotSelected 当前页未选数据 * */ resolveAllSelection() { const currentPageData = (this.$refs.tableReff.getTableDat..原创 2022-01-07 14:58:30 · 811 阅读 · 0 评论 -
验证json中含有HTML的内容,只保留 HTML标签内的数据
/**因为 账单采取了虚拟列表 搜索时做了高亮,改变了data的数据eg: 原始数据: “something” 改变后: “something”需要删掉 json中的 字符串拼接@param {string} value/export function initSearchVal(value) {const regEx_html = /<\s/?\s*a-zA-z_[^>"]>/gconst str = value.replace(regEx_html, ‘’)r原创 2021-10-28 15:12:04 · 170 阅读 · 0 评论 -
vue表单验证手机号非必填验证
{ required: false, trigger: 'blur', validator: (r, v, b) => { (v && !(/^(?:(?:\+|00)86)?1\d{10}$/.test(v))) ? b('手机号格式不正确') : b() } }原创 2021-04-30 21:52:56 · 1529 阅读 · 6 评论 -
vue项目常用正则表单验证 实测有效
/*是否合法IP地址*/export function validateIP(rule, value, callback) { if (value == '' || value == undefined || value == null) { callback(); } else { const reg = /^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0转载 2021-04-29 15:46:48 · 170 阅读 · 0 评论