Skip to content

请问如何重写 getMenuData方法 需要用别的路径作为根路径 #259

Open
@ChinaBygones

Description

@ChinaBygones

🧐 问题描述 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
};
};

🚑 其他信息 Other information

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions