简体   繁体   English

AppGyver类固醇选项卡页面刷新

[英]AppGyver Steroids tab Page Refresh

I've got tabs setup for my app using the config file as so: 我已经使用配置文件为我的应用设置了标签页,如下所示:

steroids.config.tabBar.tabs = [
   {
     title: "Index"
     icon: "icons/home.png"
     location: "http://localhost/index.html"
   },
   {
     title: "Top 10"
     icon: "icons/top10.png"
     location: "http://localhost/top10.html"
   },
   {
     title: "Buscar"
     icon: "icons/search.png"
     location: "http://localhost/search.html"
   },
   {
     title: "Favoritos"
     icon: "icons/favs.png"
     location: "http://localhost/favs.html"
   },
   {
     title: "Recomendado"
     icon: "icons/search.png"
     location: "http://localhost/search.html"
   },

 ]

This works fine. 这很好。 The problem is on the Favs page I am trying to get it to refresh at each time it's clicked. 问题出在“收藏夹”页面上,我想让它在每次单击时刷新。 Right now I cannot find a way to do this. 现在,我找不到办法。 My current code is inside the jQuery Document Ready function so it works and refreshes the favs list when first entered. 我当前的代码在jQuery Document Ready函数内部,因此它可以工作并在首次输入时刷新收藏夹列表。 But in subsequent times to the page it doesn't refresh. 但是在随后的页面中它不会刷新。 How do I get this page to refresh my list each time it's entered? 如何在每次输入列表时刷新此页面?

I have made this work using the visibilitychange event as described here: http://docs.appgyver.com/en/edge/steroids_Steroids%20Native%20UI_events_events.visibilitychange.md.html 我已经按照此处所述使用visibilitychange事件来完成这项工作: http : //docs.appgyver.com/en/edge/steroids_Steroids%20Native%20UI_events_events.visibilitychange.md.html

The final correct code to get this to work was: 使此工作正常的最终正确代码是:

document.addEventListener("visibilitychange", getFavs, false);

Placing this inside the JS file of the tab worked perfectly. 将其放在选项卡的JS文件中可以很好地工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM