const gerQueryParams =() => {
const searchStr = window.location.search.substring(1)
return searchStr.split('&').reduce((params, cur) => {
const [k, v] = cur.split('=').map(decodeURIComponent)
params[k] = v
return params
}, {})
}
const gerQueryParams =() => {
const searchStr = window.location.search.substring(1)
return searchStr.split('&').reduce((params, cur) => {
const [k, v] = cur.split('=').map(decodeURIComponent)
params[k] = v
return params
}, {})
}
本文标题:split方式获取query参数
本文链接:https://www.haomeiwen.com/subject/nvuzohtx.html
网友评论