javascript - vue-router routing jump problem
阿神
阿神 2017-05-19 10:36:34
0
1
666

There is a return button in the upper left corner. When clicked, you will return to the previous route.

What I want is to use router.go(-1);

But if you open Baidu at the beginning, and then open this page, you will return to Baidu. That does not work.

What I want to solve is to click the return button. If there is no route, you cannot jump. Don't know the idea.

阿神
阿神

闭关修行中......

reply all(1)
过去多啦不再A梦

For security reasons, we cannot directly obtain the information in the history and can only jump backward through exposed methods;

One of my ideas is to use the method exposed by the router beforeRouterLeave to make judgments in conjunction with the current route to prevent jumps.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template