在umi3里面,跳转时传参数写法
// 带参数跳转到指定路由
history.push('/list?a=b');
history.push({
pathname: '/list',
query: {
a: 'b',
},
});
在umi4里面,跳转时传参数写法
// 带参数跳转到指定路由
history.push('/list?a=b&c=d#anchor');
history.push({
pathname: '/list',
search: '?a=b&c=d',
hash: 'anchor',
});
如果想在umi4中传多个参数时跳转时传参数写法
history.push('/library/identificationLibrary/information', record);
此时第二个参数便是想要传的值
const location = useLocation();
使用useLocation就可以收到你想要的值了