Javascript 在react路由器中添加多个url参数
我必须选择触发下一个功能的选项:Javascript 在react路由器中添加多个url参数,javascript,reactjs,react-router,Javascript,Reactjs,React Router,我必须选择触发下一个功能的选项: const firstQuery=(值)=>{ replace(`${match.path}cars/?car=${value}`); }; const secondQuery=(值)=>{ replace(`${match.path}cars/?color=${value}`); };history.replace,替换整个url,因此您必须在其中设置完整的url constsecondquery=(value1,value2)=>{ replace(`$
const firstQuery=(值)=>{
replace(`${match.path}cars/?car=${value}`);
};
const secondQuery=(值)=>{
replace(`${match.path}cars/?color=${value}`);
};代码>history.replace,替换整个url,因此您必须在其中设置完整的url
constsecondquery=(value1,value2)=>{
replace(`${match.path}cars?car=${value1}和color=${value2}`);
};代码>