📌  相关文章
📜  在 typescript 中重新加载页面 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:50.047000             🧑  作者: Mango

代码示例2
this.router.routeReuseStrategy.shouldReuseRoute = function(){
            return false;
         };
this.router.events.subscribe((evt) => {
            if (evt instanceof NavigationEnd) {
               // trick the Router into believing it's last link wasn't previously loaded
               this.router.navigated = false;
               // if you need to scroll back to top, here is the right place
               window.scrollTo(0, 0);
            }
        });