取地址中的参数值工具

This commit is contained in:
Yuanjianghong 2021-11-30 16:16:44 +08:00
parent 2072ece81d
commit 1818eb00ee
1 changed files with 5 additions and 16 deletions

View File

@ -110,18 +110,7 @@ export function dictToTree(list, tree, parentId) {
return tree return tree
} }
//列表转🌲 //拿地址路径中的参数,不能用$route取的就用这个取
// export function list2Tree(list, parentId) { export function getUrlKey(name) {
// let obj = [] return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.href) || [, ""])[1].replace(/\+/g, '%20')) || null
// list.forEach(item => { }
// item.children = []
// obj[item.id] = item
// })
// return list.filter(item => {
// if (item.parentId !== parentId) {
// obj[item.parentId].children.push(item)
// return false
// }
// return true
// })
// }