Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/reactjs/21.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 在react路由器中添加多个url参数_Javascript_Reactjs_React Router - Fatal编程技术网

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}`);
};