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;
}
})
Source:stackexchange.com