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