How to solve the problem that vue falls back into an endless cycle?

clipboard.png

if the page jump looks like this:
A page B page C page B page B page C page

then when I click back, I will fall into the previous action
C page "B page" B page "A page

this affects the user experience very much, how to solve this problem generally?

and I thought of a way: the back button of the
B page specifies to jump to page An and assume that it is a return.
but... Users can jump from E page to B page, or from F page to B page


this still depends on the business. If your BC page belongs to the process page and A belongs to the start page, you can use replace instead of push from A to B, so that you can go back to the start page directly in any process page.


from C page to B page with this.$router.back () , cross-page returns such as directly returning to page A can use this.$router.go (- 2) , if you use the push jump way will produce a new record in the browsing history.

Menu