css - 如何获取页面唯一标识符
阿神
阿神 2017-04-17 15:25:02
0
2
432

在构建单页应用中,我需要知道用户进入这个页面,到底是后退,还是前进访问这个页面的。
目前我暂时只知道history.state.key这个可以判断,不知道还有没有其他的方案

看了一下vue-router的源码,只支持对全局滚动条进行保存

阿神
阿神

闭关修行中......

reply all(2)
刘奇

Generally, the routing of a single page is controlled by hash. You can monitor the window.onhashchange event
evt.oldURL and you can see the hash of the previous step, and use this to determine whether to move forward or backward
Then combine it with local storage to do what you want

小葫芦

sessionStorage。

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