function getQueryString(name){
const reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)');
const r = window.location.search.substr(1).match(reg) || window.location.hash.substring((window.location.hash.search(/\?/)) + 1).match(reg);
if (r != null) {
return decodeURIComponent(r[2]);
}
}
js获取url参数,支持vue hash模式
最新推荐文章于 2023-11-10 22:03:06 发布