const getUrl = key => {
let result = null;
const url = window.location.href.split(`?`);
if (url.length > 1) {
url[1].split(`&`).map(item => {
const res = item.split(`=`);
if (res[0] === key) {
result = res[1];
}
});
}
return result;
};
url处理
阅读 45
2022-09-29
const getUrl = key => {
let result = null;
const url = window.location.href.split(`?`);
if (url.length > 1) {
url[1].split(`&`).map(item => {
const res = item.split(`=`);
if (res[0] === key) {
result = res[1];
}
});
}
return result;
};
相关推荐
精彩评论(0)