在 ionic 3 中关闭模态后 setRoot() 不工作
setRoot() not working after dismiss modal in ionic 3
我尝试在 ionic 3 中关闭模态后设置根目录,但它不能正常工作。
我想让根 /opportunities/opportunities-detail 在打开后更改为 opportunities/opportunities-unit 并且 select 模态值
它只有在我像这样使用主根导航时才有效
this.app.getRootNav().setRoot('OpportunitiesUnitPage');
但我不想在它之前更改我的根,我只想在打开模式后推送新根
我试过了,但没用
this.navCtrl.push('OpportunitiesUnitPage', {});
这是我完成的完整代码
机会-detail.ts
let modalQualifyVerify = this.modalCtrl.create('OpportunitiesNotifPage', {
meta: this.meta,
opportunity:this.opportunity,
selection: this.savedSelection,
status: 'unitSelect'}, {cssClass: 'select-modal-unit' });
modalQualifyVerify.onDidDismiss(data => {
});
modalQualifyVerify.present();
机会-notif.ts
changeUnit(){
this.viewCtrl.dismiss(null);
this.navCtrl.push('OpportunitiesUnitPage', {
meta: this.meta,
opportunity: this.opportunity,
selection: this.savedSelection
});
}
你们能帮我解决一下吗?谢谢 :)
我已经找到了回答者,
我关闭模态后设置root,这是我制作的完整代码
机会-notif.ts
changeUnit(){
var dismissData = {status:'unitPage'};
this.viewCtrl.dismiss(dismissData);
}
机会-detail.ts
let modalQualifyVerify = this.modalCtrl.create('OpportunitiesNotifPage', {
meta: this.meta,
opportunity:this.opportunity,
selection: this.savedSelection,
status: 'unitSelect'}, {cssClass: 'select-modal-unit' });
modalQualifyVerify.onDidDismiss(data => {
if(data.status == "unitPage"){
this.navCtrl.push('OpportunitiesUnitPage', {
meta: this.meta,
opportunity: this.opportunity,
selection: this.savedSelection
});
}
});
modalQualifyVerify.present();
我尝试在 ionic 3 中关闭模态后设置根目录,但它不能正常工作。 我想让根 /opportunities/opportunities-detail 在打开后更改为 opportunities/opportunities-unit 并且 select 模态值
它只有在我像这样使用主根导航时才有效
this.app.getRootNav().setRoot('OpportunitiesUnitPage');
但我不想在它之前更改我的根,我只想在打开模式后推送新根 我试过了,但没用
this.navCtrl.push('OpportunitiesUnitPage', {});
这是我完成的完整代码 机会-detail.ts
let modalQualifyVerify = this.modalCtrl.create('OpportunitiesNotifPage', {
meta: this.meta,
opportunity:this.opportunity,
selection: this.savedSelection,
status: 'unitSelect'}, {cssClass: 'select-modal-unit' });
modalQualifyVerify.onDidDismiss(data => {
});
modalQualifyVerify.present();
机会-notif.ts
changeUnit(){
this.viewCtrl.dismiss(null);
this.navCtrl.push('OpportunitiesUnitPage', {
meta: this.meta,
opportunity: this.opportunity,
selection: this.savedSelection
});
}
你们能帮我解决一下吗?谢谢 :)
我已经找到了回答者, 我关闭模态后设置root,这是我制作的完整代码
机会-notif.ts
changeUnit(){
var dismissData = {status:'unitPage'};
this.viewCtrl.dismiss(dismissData);
}
机会-detail.ts
let modalQualifyVerify = this.modalCtrl.create('OpportunitiesNotifPage', {
meta: this.meta,
opportunity:this.opportunity,
selection: this.savedSelection,
status: 'unitSelect'}, {cssClass: 'select-modal-unit' });
modalQualifyVerify.onDidDismiss(data => {
if(data.status == "unitPage"){
this.navCtrl.push('OpportunitiesUnitPage', {
meta: this.meta,
opportunity: this.opportunity,
selection: this.savedSelection
});
}
});
modalQualifyVerify.present();