[Vuejs]-I want to add a forgotten password page to my login page, but I can't jump to it after I update the code

0đź‘Ť

âś…

if (to.path === "/forgetPassword") {
      next("/forgetPassword");
}

As Matt Ellen user suggested, this will create an infinite loop, since navigating to “/forgetpassword” triggers the router beforeEach hook again.

Simply next(); should solve this problem.

Leave a comment