取地址中的参数值工具
This commit is contained in:
parent
2072ece81d
commit
1818eb00ee
|
@ -110,18 +110,7 @@ export function dictToTree(list, tree, parentId) {
|
|||
return tree
|
||||
}
|
||||
|
||||
//列表转🌲
|
||||
// export function list2Tree(list, parentId) {
|
||||
// let obj = []
|
||||
// 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
|
||||
// })
|
||||
// }
|
||||
//拿地址路径中的参数,不能用$route取的就用这个取
|
||||
export function getUrlKey(name) {
|
||||
return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.href) || [, ""])[1].replace(/\+/g, '%20')) || null
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue