Open
Description
🧐 问题描述 Problem Description
请问如何重写 getMenuData方法 需要用别的路径作为根路径
我看到官方在代码里写的
routes.find((route) => route.path === "/"
我需要把这个 “/” 改成自定义的,有提供什么api或者重写吗
💻 示例代码 Sample code
const getMenuData = (routes) => {
console.log(routes);
const childrenRoute = routes.find((route) => route.path === "/");
const breadcrumb = {};
return {
menuData: formatRelativePath((childrenRoute == null ? void 0 : childrenRoute.children) || [], breadcrumb),
breadcrumb
};
};