本文介紹了如何在 ionic2 中的 pop() 之后重新加載離子頁面的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!
問題描述
我有 2 頁 Page1 和 Page2
.我在 Page2 中使用了 this.nav.pop()
,它會彈出 Page2 并且 Page1 將啟用,但我想刷新 Page1.先感謝您.
I have 2 pages Page1 and Page2
. I have used this.nav.pop()
in Page2 and it will pop the Page2 and Page1 will enable but i want to refresh the Page1.
Thank you in advance.
推薦答案
您可以將父頁面與導航推送一起傳遞.這樣您就可以將父頁面作為 navParamter 訪問.
在父頁面中:
you could pass the parent page along with the nav push. that way you could accces the parent page as a navParamter.
in parent page:
goToChildPage() {
this.navCtrl.push(ChildPage, { "parentPage": this });
}
在彈出之前的子頁面中,您可以調用父頁面上的函數(shù)
and in the child page before pop you could call functions on parent page
this.navParams.get("parentPage").someFnToUpdateParent();
//or
this.navParams.get("parentPage").someFnToRefreshParent();
這篇關于如何在 ionic2 中的 pop() 之后重新加載離子頁面的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!
【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權益,請聯(lián)系我們刪除處理,感謝您的支持!