提交 52a97eb4 编写于 作者: zhujiamin's avatar zhujiamin

菜单默认打开

上级 b269711e
...@@ -147,10 +147,7 @@ export default class AppMobMenuDefaultView extends Vue { ...@@ -147,10 +147,7 @@ export default class AppMobMenuDefaultView extends Vue {
} }
let count = 0; let count = 0;
this.items.forEach((item:any,index:number) => { this.items.forEach((item:any,index:number) => {
if(item.hidden == false){ if(item.opendefault == true){
count++;
}
if(count == 1){
this.activeId = item.id; this.activeId = item.id;
} }
let model = this.menuModels.find((model:any) => Object.is(model.appfunctag, item.appfunctag)); let model = this.menuModels.find((model:any) => Object.is(model.appfunctag, item.appfunctag));
...@@ -176,7 +173,12 @@ export default class AppMobMenuDefaultView extends Vue { ...@@ -176,7 +173,12 @@ export default class AppMobMenuDefaultView extends Vue {
ionNav.select(item.name); ionNav.select(item.name);
} }
}) })
} } else {
let item:any = this.items.find((item: any) => Object.is(item.id, this.activeId));
if (ionNav && ionNav.select) {
ionNav.select(item.name);
}
}
} }
/** /**
......
...@@ -187,10 +187,7 @@ export default class AppMobMenuSideslipView extends Vue { ...@@ -187,10 +187,7 @@ export default class AppMobMenuSideslipView extends Vue {
} }
let count = 0; let count = 0;
this.items.forEach((item:any,index:number) => { this.items.forEach((item:any,index:number) => {
if(item.hidden == false){ if(item.opendefault == true){
count++;
}
if(count == 1){
this.activeId = item.id; this.activeId = item.id;
} }
let model = this.menuModels.find((model:any) => Object.is(model.appfunctag, item.appfunctag)); let model = this.menuModels.find((model:any) => Object.is(model.appfunctag, item.appfunctag));
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册