提交 b5e490d7 编写于 作者: Neuromancer255's avatar Neuromancer255

实现刷新不重置菜单项

上级 afc66b58
......@@ -131,6 +131,25 @@ export default class AppMobMenuDefaultView extends Vue {
this.loadCounterData();
}
/**
* 生命周期
*
* @memberof AppMobMenuDefaultView
*/
public mounted() {
let ionNav:any = this.$refs.ionNav;
let currPage = sessionStorage.getItem("currId");
this.items.forEach((item:any,index:number) => {
if(currPage){
if(item.id == currPage){
this.activeId = currPage ;
ionNav.select(item.name);
}
}
})
}
/**
* 点击菜单事件
*
......@@ -139,6 +158,7 @@ export default class AppMobMenuDefaultView extends Vue {
public active(val:any) {
const index :number = this.items.findIndex((item: any) => Object.is(item.id, val.id));
this.activeId = this.items[index].id;
sessionStorage.setItem("currId",this.items[index].id)
}
/**
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册