kittencup / angular2-ama-cn

angular2 随便问
692 stars 101 forks source link

2.0的正式版 路由3.0.0 跳转 会插入history 2次,点击后退时, 路由状态切换了,但是地址栏没有变 #216

Closed Alsmile closed 7 years ago

Alsmile commented 7 years ago

2.0的正式版 路由3.0.0 跳转 会插入history 2次,点击后退时, 路由状态切换了,但是地址栏没有变。再单击一次后退,地址栏变了,路由又后退了一次。 而且浏览器“前进”一直被禁用。路由和history完全乱了。

请问,这个是怎么回事

Alsmile commented 7 years ago

知道原因了。RouterModule.forRoot 只能在根模块使用一次, 其他模块只能使用RouterModule.forChild