http://localhost:3001/?id=123&type=456#/
getQueryName = (name) => {
var result = (window.location.search || window.location.href).match(new RegExp("[\?\&]" + name + "=([^\&]+)", "i"));
if (result == null || result.length < 1) {
return "";
}
return decodeURIComponent(result[1]);
}
this.getQueryName(id) // 123
this.getQueryName(type) // 456
获取url的路径信息
最新推荐文章于 2020-11-17 11:39:54 发布