// 映射关系 id:routeUrl
const routeMap = {
"111": "/AAA/",
"222": "/BBB/",
"333": "/CCC/",
};
// ...
const id="111"
const routeUrl = routeMap[id] + otherParam + "/" + otherParam;
// routeUrl = `/AAA/${otherParam}/${otherParam}`
[前端-React] 根据映射关系拼接路由
最新推荐文章于 2025-05-28 18:15:13 发布