For my specific situation, it is crucial to understand how the route is modified. I need to be able to detect when the route changes due to a user clicking the back button on their browser or mobile device.
This is the code snippet I currently have:
router.beforeEach((to, from, next) => {
if ( /* IsItABackButton && */ from.meta.someLogica) {
next(false)
return ''
}
next()
})
Are there any existing solutions that I can utilize in place of the IsItABackButton
comment? While Vue-router itself may not provide an automatic solution, I am open to any workarounds that could achieve this. Alternatively, is there a preferred method for identifying these back button interactions?