Is beforeUnmountthe best solution? #8791
-
Hi I am pretty newie in quasar and Vue. I'm developing an app with quasar and I need to check if a condition is true before change of page. If this condition it's not true the use can't change of screen and a message needs to be displayed saying it. I don't know if is possible check it in beforeUnmount because I believe it is only for animations. As I say we don't need it checked only when a user presses the button for change to another page. We need it when he presses the back button too. Someone can help me? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
@IvanWala try one of the vue component router guards https://router.vuejs.org/guide/advanced/navigation-guards.html#in-component-guards, specifically |
Beta Was this translation helpful? Give feedback.
@IvanWala try one of the vue component router guards https://router.vuejs.org/guide/advanced/navigation-guards.html#in-component-guards, specifically
beforeRouteLeave
, see their example.