摘要:
截取浏览器url function getBowserUrl(path) { let result = ''; if (path) { // 获取当前URL var currentURL = window.location.href; // 使用URL API来解析URL var urlObject 阅读全文
摘要:
function flatFormat(arr, result = []) { for (let i; i < arr.length; i++) { if (Array.isArray(arr[i])) { flatFormat(arr[i], result); } else { result.pu 阅读全文
摘要:
function listToTree(list, parentId = null) { const tree = []; for (let i = 0; i < list.length; i++) { if (list[i].parentId parentId) { const node = { 阅读全文
摘要:
function debounce(func, ms = 1000) { let timer; return function (...args) { if (timer) { clearTimeout(timer); } timer = setTimeout(() => { func.apply( 阅读全文