Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,14 @@ async function getMasterRuntime() {

// modify route with "microApp" attribute to use real component
function patchMicroAppRouteComponent(routes: IRouteProps[]) {
const { routeBindingAlias, base, masterHistoryType } = getMasterOptions() as MasterOptions;

const insertRoutes = microAppRuntimeRoutes.filter(r => r.insert);
// 先处理 insert 配置
insertRoutes.forEach(route => {
// 转化insert配置变更成 micro组件
patchMicroAppRoute(route, getMicroAppRouteComponent, { base, masterHistoryType, routeBindingAlias });
// 将转换后的micro组件,插入对应路由
insertRoute(routes, route);
});

Expand All @@ -51,7 +56,6 @@ function patchMicroAppRouteComponent(routes: IRouteProps[]) {

const rootRoutes = getRootRoutes(routes);
if (rootRoutes) {
const { routeBindingAlias, base, masterHistoryType } = getMasterOptions() as MasterOptions;
const microAppAttachedRoutes = microAppRuntimeRoutes.filter(r => !r.insert);
microAppAttachedRoutes.reverse().forEach(microAppRoute => {
const patchRoute = (route: IRouteProps) => {
Expand Down