Vue-Router - Reverse transition on navigating back

Viewed 709

I'm trying to implement a slide transition for the <router-view> component that slides content to the left upon navigating to a different page. To make things more intuitive, I'd like to reverse the transition if the user navigates back (which is achieved by swiping to the right on mobile and MacOS already). I already found an example in the vue-router documentation here, but it only applies to routes nested deeper, eg. with an additional URI segment.
I also found several SO questions and this issue which has an example for Vue1, but I'm using Vue2 so this is not relevant anymore.

Has anyone solved this? How would I go about reversing transitions on history navigation?

enter image description here

0 Answers
Related