首页 > 解决方案 > 一旦应用程序关闭并打开,除非我移至下一页,否则不会显示离子滑块图像

问题描述

//// 我在哪里得到数据

for (var i = 0; i < res.length; i++) {
  let record: any = {};
  record.slide = res.item(i).slide;
  records.push(record);
}

this.productsService.setslidesList = records;
setTimeout(() => {
  this.slider_img = records;
  console.log(this.slider_img)
  this.errInfo = false;
}, 300)

/// 它显示错误图像,除非我重定向到另一个页面开始正常工作。

标签: angularionic3

解决方案


       function reloadPage() {
            var currentDocumentTimestamp = new Date(performance.timing.domLoading).getTime();
            // Current Time //
            var now = Date.now();
            // Total Process Lenght as Minutes //
            var tenSec = 10 * 1000;
            // End Time of Process //
            var plusTenSec = currentDocumentTimestamp + tenSec;
            if (now > plusTenSec) {
                location.reload();
            }
        }

试试这个,它会单次重新加载页面,我知道这不是最好的解决方案,但它在危急情况下会有所帮助。


推荐阅读