We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
请问如何重写 getMenuData方法 需要用别的路径作为根路径 我看到官方在代码里写的 routes.find((route) => route.path === "/" 我需要把这个 “/” 改成自定义的,有提供什么api或者重写吗
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 }; };
The text was updated successfully, but these errors were encountered:
不引入,直接自己写代码实现即可
https://github.com/vueComponent/pro-components/blob/next/packages/pro-layout/examples/layouts/BasicLayout.vue#L75-L82
Sorry, something went wrong.
getMenuData 这个方法略坑 它定义的是根节点,一般都拆分常驻路由和异步权限路由 所以这个逻辑是有问题的
No branches or pull requests
🧐 问题描述 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
The text was updated successfully, but these errors were encountered: