Skip to content
New issue

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

fix(qiankun): runtime routes not loaded correctly #541

Merged
merged 1 commit into from
Mar 18, 2021

Conversation

shushushv
Copy link
Contributor

plugin-layout 和 plugin-qiankun 一起使用时,微应用配置的运行时路由没有被正确的添加到 layout 的 routes 中。

umi 自动生成的路由:

export function getRoutes() {
  const routes = [
  {
    "path": "/",
    "component": require('yourProject/src/.umi/plugin-setting-drawer/SettingDrawer.tsx').default,
    "routes": [
      {
        "path": "/",
        "component": require('yourProject/src/.umi/plugin-layout/Layout.tsx').default,
        "routes": [
          {
            "path": "/",
            "component": require('@/layouts/index').default,
            "routes": [
              {
                "path": "/home",
                "component": require('@/pages/home').default,
                "exact": true
              }
            ]
          }
        ]
      }
    ]
  }
];

src/app.ts 中添加的 qiankun 配置:

export const qiankun = fetch('/config').then(({ apps }) => {
  return {
    apps,
    routes: [
      {
        path: '/app1',
        microApp: 'app1',
      }    
    ]
  }
});

@codecov
Copy link

codecov bot commented Feb 20, 2021

Codecov Report

Merging #541 (9486b1b) into master (d931276) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #541   +/-   ##
=======================================
  Coverage   47.60%   47.60%           
=======================================
  Files          66       66           
  Lines        1542     1542           
  Branches      424      424           
=======================================
  Hits          734      734           
  Misses        807      807           
  Partials        1        1           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2b2c169...9486b1b. Read the comment docs.

@kuitos kuitos merged commit ea086ee into umijs:master Mar 18, 2021
kuitos added a commit that referenced this pull request Mar 19, 2021
kuitos added a commit that referenced this pull request Mar 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants