标头不同的网页,互相传值 通过内存什么的
+在旧页面要跳转的地方
goHome() {
window.location.href =
"http://xxxxxxxxxxxxxxxxxxx/?token=" +
localStorage.getItem("token") +
"&username=" +
localStorage.getItem("username");
---------------------------------------我这里的数据是存在本地的所以如上
},
- 跳转到新页面以后
参考:https://blog.csdn.net/DcTbnk/article/details/107765017
最好在新页面的
mounted() {
const params = new URLSearchParams(window.location.search);
const token = params.get("token");
const username = params.get("username");
}
可以通过xxx.get("x")获取到你url上面附带的内容

浙公网安备 33010602011771号