// 解析URL路由传参 const urlParams = () => { const strParams = decodeURI(location.search.replace('?', '')) const arrParams = strParams.split('&') const params = {} for (const param of arrParams) { const arrParam = param.split('=') params[arrParam[0]] = arrParam[1] } return params }
标签:传参,const,URL,arrParam,params,路由 From: https://www.cnblogs.com/webtown/p/17771948.html