摘要: 问题:在项目开发时,有时需要获取 冒泡或捕获 过程的所有元素 解决方案: 1、Chrome通过event.path获取: const ev = window.event || event; const path = ev.path; 2、Firefox和Safari中获取 const ev = wi 阅读全文
posted @ 2021-06-16 19:16 赛德·乌漆嘛黑 阅读(44) 评论(0) 推荐(0) 编辑
摘要: 1、节流实现 /** * @desc 函数节流 * @param func 函数 * @param wait 延迟执行毫秒数 */ const throttle = (fn, wait) => { // 上一次执行 fn 的时间 let previous = 0 // 将 throttle 处理结果 阅读全文
posted @ 2021-06-16 19:08 赛德·乌漆嘛黑 阅读(92) 评论(1) 推荐(0) 编辑
摘要: 1、setting.json 配置 { "editor.codeActionsOnSave": { "source.fixAll.eslint": true }, "workbench.iconTheme": "vscode-icons", "workbench.colorTheme": "Drac 阅读全文
posted @ 2021-06-16 13:48 赛德·乌漆嘛黑 阅读(53) 评论(0) 推荐(0) 编辑