let local='http://1.15.15.243/#/pages/index/index?id=19&code=18435297'
// let local = window.location.href;
// console.log('页面路径', local);
var queryObj = {};
if (local.indexOf('?') != -1) {
var search = local.slice(local.indexOf('?') + 1).split('&');
// console.log('-----22', search);
search.forEach((value, index, array) => {
queryObj[value.slice(0, value.indexOf('='))] = value.slice(value.indexOf('=') + 1);
});
}
console.log('页面参数code', queryObj.code);
页面路径的参数截取
最新推荐文章于 2022-02-24 10:54:56 发布