Closed wuyiqun0718 closed 3 years ago
因为第一次加载model的时候才会将history监听器加入监听,后续进入同样的路径,监听器才会触发。所以要在加入监听器时,同时触发一次。不然第一次进去一个页面,history监听器就不会触发了。
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
https://github.com/dvajs/dva/blob/fa5b8a4809d92466c8c2950d4235855830d37c1e/packages/dva/src/index.js#L106-#L125
在我们的项目中引入dva中的history想用来监听路由变化,但是看源代码发现监听时就会直接callback闭包里的history实例,这个不符合常理吧?原生的history是没有做这样的处理的。