上一页 1 2 3 4 5 6 ··· 21 下一页
摘要: function deepClone(obj) { if (obj null) return null; if (typeof obj !== 'object') return obj; if (obj instanceof Date) { let date = new Date(); date.s 阅读全文
posted @ 2023-07-07 09:30 Panax 阅读(1) 评论(0) 推荐(0) 编辑
摘要: // 把若干数组按指定的字段名进行分组 function groupBy(list, propName) { return list.reduce((acc, item) => { const key = item[propName]; if (!acc[key]) { acc[key] = []; 阅读全文
posted @ 2023-07-07 09:28 Panax 阅读(13) 评论(0) 推荐(0) 编辑
摘要: // 身份证号function isIdCard(str) { return /^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/.test(str); } // 阅读全文
posted @ 2023-07-07 09:17 Panax 阅读(9) 评论(0) 推荐(0) 编辑
摘要: // 可被用来过渡的background-color background-position border-color border-width border-spacing bottom color font-size font-weight height left letter-spacing 阅读全文
posted @ 2023-07-07 09:09 Panax 阅读(1) 评论(0) 推荐(0) 编辑
摘要: animation-name: myanimation; // 动画名字,指定关键帧的名字。 animation-duration: 4s; // 动画持续时间,间接控制速率,越长越慢! animation-iteration-count: infinite; // 重复次数,可以填数字也可以填in 阅读全文
posted @ 2023-07-07 08:59 Panax 阅读(1) 评论(0) 推荐(0) 编辑
摘要: HTML部分 <body> <div class="box"></div> </body> css部分 // 设置背景颜色 body { background: #333; } .box { background: #fff; // 设置显眼的颜色 width: 200px; // 固定宽,为了看的 阅读全文
posted @ 2023-07-07 08:54 Panax 阅读(1) 评论(0) 推荐(0) 编辑
摘要: // 单行显示.oneline { overflow: hidden; word-break: break-all; text-overflow: ellipsis; -webkit-box-orient: horizontal; -webkit-line-clamp: 1; line-clamp: 阅读全文
posted @ 2023-07-07 08:36 Panax 阅读(4) 评论(0) 推荐(0) 编辑
摘要: /** * 获取地图上两点间距离。单位:米 * @param {lat1} 第一个点的纬度 * @param {lon1} 第一个点的经度 * @param {lat2} 第二个点的纬度 * @param {lon2} 第二个点的经度 * @author 人参 */ export function 阅读全文
posted @ 2023-07-06 15:36 Panax 阅读(4) 评论(0) 推荐(0) 编辑
摘要: /** * 节流 * 在给定时间内只有第一次的操作会返回结果 * 结合了防抖的思路:在delay时间内生成定时器,一旦到了delay的时间就返回结果 * 当用户只点击了一次的时候,在delay时间后得到结果 * 当用户点击了多次的时候,在delay时间后得到第一次的结果,其余的被节流阀忽视掉 * @ 阅读全文
posted @ 2023-07-06 14:39 Panax 阅读(11) 评论(0) 推荐(0) 编辑
摘要: export function verifyNull(data){ if(data '' || data 'undefined' || data 'null' || data null || (typeof(data) 'string' && data.trim() '') || JSON.stri 阅读全文
posted @ 2023-03-09 09:12 Panax 阅读(20) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 21 下一页