NuxtN
Nuxt15mo ago
CFHxKai

How to prevent navigation in nested routes?

I have a route like /[firstId]/[secondId]. The page [firstId] has a list of links to navigate and a <NuxtPage /> to load a page with the form from secondId data, but before change between nested secondId's routes I'm checking if the form is dirty and trying to prevent navigation asking to user if he really wants to leave and lost the changes.

But in nested page the onBeforeRouteLeave don`t work.
There is another way to achieve this?

Thank you 👍
Was this page helpful?