worktile / ngx-planet

🚀🌍🚀A powerful, reliable, fully-featured and production ready Micro Frontend library for Angular.
http://planet.ngnice.com
MIT License
539 stars 66 forks source link

在子应用中使用路由时,浏览器后退需要点多次才可后退 #288

Closed my5201314zwl closed 1 year ago

my5201314zwl commented 1 year ago

Describe the bug 子项目中 const routes: Routes = [{ path: '', component: HelloComponent, children: [ { path: '', redirectTo: 'test1', pathMatch: 'full' }, { path: 'test1', component: Test1Component }, { path: 'test2', component: Test1Component } ] }];

在test1和test2间进行路由切换,此时浏览器后退按钮不好用。

To Reproduce Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem. 1686272470367

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional context Add any other context about the problem here.

why520crazy commented 1 year ago

微前端下使用 redirectTo 和 pathMatch: 'full' 有问题,

[
 {
   path: '', 
   redirectTo: 'test1', 
    pathMatch: 'full'
  },
]

升级到 15.1.1 版本,替换成 redirectToRoute 即可

[
 redirectToRoute('test1')
]