Commit 179d702c authored by zL's avatar zL

缓存currentRoute

parent c8f52f26
...@@ -42,22 +42,17 @@ let UrlPrefixObj = require("@/config/UrlPrefix"); ...@@ -42,22 +42,17 @@ let UrlPrefixObj = require("@/config/UrlPrefix");
export default { export default {
data() { data() {
return { return {
currentRoute: 0, currentRoute: Number(sessionStorage.getItem("currentRoute")),
}; };
}, },
mounted() { mounted() {},
if (this.$route.path === "/userCenter") {
this.currentRoute = 2;
} else {
this.currentRoute = 0;
}
},
methods: { methods: {
selectPage(idnex, path) { selectPage(idnex, path) {
if (idnex === 1) { if (idnex === 1) {
window.open(UrlPrefixObj.model.CHAIN_BROWSER_URL_PREFIX); window.open(UrlPrefixObj.model.CHAIN_BROWSER_URL_PREFIX);
} else { } else {
if (this.currentRoute === idnex) return; if (this.currentRoute === idnex) return;
sessionStorage.setItem("currentRoute", idnex);
this.currentRoute = idnex; this.currentRoute = idnex;
this.$router.push({ path: path }); this.$router.push({ path: path });
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment