fixed:修改本地缓存菜单
parent
1def7b5d35
commit
780ae493ad
|
@ -54,8 +54,8 @@ export default class HeaderComponent extends Vue {
|
||||||
public timer;
|
public timer;
|
||||||
public showPageList = false;
|
public showPageList = false;
|
||||||
public pageList = pageListData;
|
public pageList = pageListData;
|
||||||
public currentPage = JSON.parse(localStorage.getItem("currentPage") as any) || this.pageList[0];
|
public currentPage = JSON.parse(localStorage.getItem("currentPage-train") as any) || this.pageList[0];
|
||||||
public currentNav = localStorage.getItem("currentNav") || this.currentPage.children[0].value;
|
public currentNav = localStorage.getItem("currentNav-train") || this.currentPage.children[0].value;
|
||||||
public showArrow = false;
|
public showArrow = false;
|
||||||
|
|
||||||
public showContent = true;
|
public showContent = true;
|
||||||
|
@ -87,9 +87,9 @@ export default class HeaderComponent extends Vue {
|
||||||
}
|
}
|
||||||
public selectPage(data){
|
public selectPage(data){
|
||||||
this.currentPage = data;
|
this.currentPage = data;
|
||||||
localStorage.setItem("currentPage",JSON.stringify(data))
|
localStorage.setItem("currentPage-train",JSON.stringify(data))
|
||||||
this.currentNav = data.value;
|
this.currentNav = data.value;
|
||||||
localStorage.setItem("currentNav",data.value)
|
localStorage.setItem("currentNav-train",data.value)
|
||||||
this.navChange()
|
this.navChange()
|
||||||
this.showPageList = false;
|
this.showPageList = false;
|
||||||
this.navLeft = 0;
|
this.navLeft = 0;
|
||||||
|
@ -101,7 +101,7 @@ export default class HeaderComponent extends Vue {
|
||||||
|
|
||||||
public selectNav(data){
|
public selectNav(data){
|
||||||
this.currentNav = data.value;
|
this.currentNav = data.value;
|
||||||
localStorage.setItem("currentNav",data.value)
|
localStorage.setItem("currentNav-train",data.value)
|
||||||
this.navChange()
|
this.navChange()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -129,8 +129,8 @@ export default class HeaderComponent extends Vue {
|
||||||
beforeDestory(){
|
beforeDestory(){
|
||||||
clearInterval(this.timer);
|
clearInterval(this.timer);
|
||||||
this.timer = null;
|
this.timer = null;
|
||||||
localStorage.removeItem("currentPage")
|
localStorage.removeItem("currentPage-train")
|
||||||
localStorage.removeItem("currentNav")
|
localStorage.removeItem("currentNav-train")
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue