gpt4 book ai didi

angular - 侧边菜单和页面在再次设置根页面后没有响应 Ionic 2 Beta 11

转载 作者:搜寻专家 更新时间:2023-10-30 22:01:24 25 4
gpt4 key购买 nike

您好,我正在使用 Ionic 2 Beta 11。登录后我在登录页面我将页面设置为根页面登录后页面显示并且菜单图标也显示但是当我点击页面屏幕上的页面按钮和菜单图标时页面没有响应并且也是菜单不起作用。我尝试了这些解决方案,但都不起作用

this.navCtrl.setRoot(AppointmentsPage);

 this.app.getRootNav().setRoot(AppointmentsPage)

这是我的代码。

onLogin(form) {
this.submitted = true;
if (form.valid) {
this.networkservice.showLoading();
var data = this.userData.login(this.login.email,this.login.password);
console.log(data);
data.subscribe(res => {
if(res.length == 0 ) {
this.login.isVaild = false;
this.networkservice.hideLoading();
}else{
this.userData.setDoctor(res[0]);
this.hideLoading();
this.navCtrl.setRoot(AppointmentsPage);


}

});

}else{
}

}

请帮我解决这个问题

最佳答案

如果有人遇到这个问题,我想我已经找到了这个世纪的主要问题。当您从“模式”或“弹出窗口”推送时会出现问题,因此会出现导航问题。要以正确的方式执行此操作,请执行 pushsetRoot '从调用 popover 或 modal 的页面改为'。这可以使用“onDidDismiss”函数轻松完成:

//Page which calls popover:
popover.create();

//Page popover: Dismiss existing popover (you may also pass a parameter)
popover.dismiss(myParameter);

//Page which calls popover: Veriry if popover was removed
popover.onDidDismiss(data => {
if(data == "something")
{
//Navigate to new page
this.nav.push(newPage)
}
});

希望对大家有帮助!

关于angular - 侧边菜单和页面在再次设置根页面后没有响应 Ionic 2 Beta 11,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40004007/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com