摘要: limitDecimals = value => { const reg = /^(\-)*(\d+)\.(\d).*$/; if (typeof value 'string') { return !isNaN(Number(value)) ? value.replace(reg, '$1$2.$3 阅读全文
posted @ 2021-02-04 17:00 dongxiaolei 阅读(857) 评论(0) 推荐(0) 编辑
摘要: 原生js判断有没有class hasClass = (ele, cName) => { let reg = new RegExp("(?:^| +)" + cName + "(?: +|$)", "g"); if(ele.className undefined){ return false; }el 阅读全文
posted @ 2021-02-04 16:38 dongxiaolei 阅读(3802) 评论(0) 推荐(0) 编辑