On the problem of vue Navigation Guard

from the first page to the second routing page, the value of from is printed out through the component guard beforeRouteEnter on the second routing page, as shown in the following figure


from

is empty and can not get the information of the first page stack. How to solve this problem


if you refresh on the second page, you will definitely not find out which page it came from.
I suggest you, when the first page goes to the second page, for example, / first-> / second
passes the routing ID of the first page to the Url of the second page, as follows:
/ second?from=first


js although you can pass window.history.back () , window.history.go () performs a browser history jump operation. But there is no way to get the browser's real History list. The reason why
vue-router can implement front-end routing and give your navigation guards form , to is only due to the fact that the front-end single-page application does not really jump to record the history path.
when you refresh your page, the data recorded by it is lost, and there is no way to get the data through the browser. It can only start all over again. Of course, you can't get the last page form .

  • Why is vue $on not triggered?

    elementuidispatch dispatch Why is it triggered only in the hook function of created, but mounted does not trigger $on, but 668 has output? it is useless for me to comment on the $on of created, why is the $on of mounted not triggered? I saw that el...

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e67a98-5ac95.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e67a98-5ac95.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?