@creekjs/umi-plugins 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -84,16 +84,22 @@ const Layout = (props: CreekLayoutProps) => {
|
|
|
84
84
|
},
|
|
85
85
|
});
|
|
86
86
|
|
|
87
|
+
const layoutRestProps = {
|
|
88
|
+
...runtimeConfig,
|
|
89
|
+
...userConfig,
|
|
90
|
+
};
|
|
91
|
+
|
|
87
92
|
// 现在的 layout 及 wrapper 实现是通过父路由的形式实现的, 会导致路由数据多了冗余层级
|
|
88
93
|
const newRoutes = filterRoutes(
|
|
89
|
-
clientRoutes
|
|
94
|
+
clientRoutes,
|
|
90
95
|
(route) => {
|
|
91
96
|
return (
|
|
92
97
|
(!!route.isLayout && route.id !== 'ant-design-pro-layout') || !!route.isWrapper
|
|
93
98
|
);
|
|
94
99
|
}
|
|
95
100
|
);
|
|
96
|
-
const
|
|
101
|
+
const layoutRoute = newRoutes.find((item) => item.id === 'ant-design-pro-layout');
|
|
102
|
+
const [route] = useAccessMarkedRoutes(mapRoutes(layoutRoute ? [layoutRoute] : []));
|
|
97
103
|
|
|
98
104
|
const matchedRoute = useMemo(
|
|
99
105
|
() => matchRoutes(route.children, location.pathname)?.pop?.()?.route,
|
|
@@ -109,6 +115,7 @@ const Layout = (props: CreekLayoutProps) => {
|
|
|
109
115
|
userConfig={userConfig}
|
|
110
116
|
route={route}
|
|
111
117
|
initialInfo={initialInfo}
|
|
118
|
+
{...layoutRestProps}
|
|
112
119
|
children={
|
|
113
120
|
runtimeConfig.childrenRender ? (
|
|
114
121
|
runtimeConfig.childrenRender(<Outlet />, props)
|