05 2021 档案

摘要:1.通过值查找属性名 const findKey = (value, obj, compare = (a, b) => a b) => { return Object.keys(obj).find(k => compare(obj[k], value)); }; 2.数字保留小数 const toF 阅读全文
posted @ 2021-05-11 11:09 Deer_Lin 阅读(54) 评论(0) 推荐(0)
摘要:https://c.runoob.com/front-end/854 //正则表达式在线测试 | 菜鸟工具 //版本号验证 V**.**.** 1.^([V]+[1-9]{1}[0-9]{0,2})+(\.[0-9]{2})+(\.[0-9]{2})$ 2. version: { pattern: 阅读全文
posted @ 2021-05-11 10:40 Deer_Lin 阅读(71) 评论(0) 推荐(0)
摘要:let spaceReplace = (str) => { //将字符串中的换行符/回车符替换为<br/>标签 // \n 匹配一个换行符, \r 匹配一个回车符 return str.replace(/\n|\r/g, '<br/>') } 2. 字符串清除dom const clearDom = 阅读全文
posted @ 2021-05-11 10:33 Deer_Lin 阅读(171) 评论(0) 推荐(0)
摘要:queryage() { //得到年龄 if (this.model.idCard && this.model.idCard.length == 18) { this.model.brthday = this.model.idCard.substring(6, 10) + '-' + this.mo 阅读全文
posted @ 2021-05-10 15:10 Deer_Lin 阅读(253) 评论(0) 推荐(0)
摘要:原因:请求接口域名未在小程序安全域名中配置。 提示: 1.域名需是https协议域名 2.如果暂时没有https请求协议域名,可打开编译工具本地设置 3.手机开发版,开启 阅读全文
posted @ 2021-05-03 16:07 Deer_Lin 阅读(254) 评论(0) 推荐(0)
摘要:子组件判断是否父组件增加@change:this.$listeners['change]) 阅读全文
posted @ 2021-05-03 15:34 Deer_Lin 阅读(323) 评论(0) 推荐(0)