I'm developing a single page application / mobile app, with VUE JS, I want to slide effect when swapping pages, and I can do it this way:
transition name="slide"
router-view
transition
But I wanted the reverse effect of the slide when the user returns the page, that is, when the user opens a new page, the page will come from the right, when you vote, the page will come from the left.
It has a plugin for vue router, called vue-router-transition ( Link ) but it does not work , is out of date, out of error, only works with very old versions of VUE.
It also has a tutorial on how to make dynamic transitions, but only works when it is child routes, such as site.com/rota1/rota2/rota3
, which is not my case: https://router.vuejs.org/en/advanced/transitions.html
I thought of the following logic, in before.each.router
, set the transition class, ( slide-left
or slide-right
) depending on whether the user clicked any Go back button, the problem is that I do not know how to apply this logic in code, would have to pass the value of a variable that is in main.js to the app.vue and I do not know how to do that ...