[Vuejs]-Change navigator back behavior on vue-routing not working for the url but ok for the view

0๐Ÿ‘

โœ…

I found a solution, I just need to do a return false; as explained here : https://router.vuejs.org/guide/advanced/navigation-guards.html#global-before-guards

router.beforeEach(async (to, from) => {
  if(panel_is_visible) {
    // if the panel is visible, close it and do not go to the "to" view
    functionToCloseThePanel()
    return false;
  }
})

Leave a comment