JavaScript获取url参数
const getParams = () => {
let params = {};
let str = window.location.hash || window.location.search;
str.slice(1).split('&').forEach((item) => params[item.split('=')[0]] = item.split('=')[1]);
return params
};
复制代码
转载于//juejin.im/post/5cb5c4b66fb9a0688d2e4044
还没有评论,来说两句吧...