如何在 Ionic 3(Ionic、Angular 5)上刷新页面 [英] How to refresh a page on Ionic 3 (Ionic, Angular 5)

查看:36
本文介绍了如何在 Ionic 3(Ionic、Angular 5)上刷新页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在构建一个收藏列表,我可以删除页面中的列表项.它基于 Ionic sqlite 存储.

I’m building a favorite list which I can erase list items within a page. It’s based on Ionic sqlite storage.

我发现 Ionic 页面将保留已删除的离子列表项,直到我重新进入列表页面.因此,它需要在从离子存储中删除项目时刷新页面.

I found Ionic page will keep removed ion list items until I re-enter the list page. So it needs refreshing a page upon removing an item from ionic storage.

如何刷新特定页面?window.location.refresh() 似乎刷新了整个页面……这不是我想要做的.

How can I refresh a particular page? window.location.refresh() seems to refresh the entire pages… this is not what I’m trying to do.

我需要在我的应用程序的 20 页中刷新一个页面,因此 navCtrl.setRoot() 也不起作用.

I need to refresh a single page out of twenty pages on my app so navCtrl.setRoot() will not work either.

提前致谢,

推荐答案

请试试这个?

this.navCtrl.setRoot(this.navCtrl.getActive().component);

这篇关于如何在 Ionic 3(Ionic、Angular 5)上刷新页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆