angular - 一旦应用程序关闭并打开,除非我移至下一页,否则不会显示离子滑块图像
问题描述
//// 我在哪里得到数据
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)
/// 它显示错误图像,除非我重定向到另一个页面开始正常工作。
解决方案
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();
}
}
试试这个,它会单次重新加载页面,我知道这不是最好的解决方案,但它在危急情况下会有所帮助。
推荐阅读
- python - 尝试从元组列表和元组创建数据框
- sql-server - SQL Server JDBC:临时表的对象无效
- c# - 强制使用“var”被解析为关键字而不是类名
- powershell - 如何创建 powershell 脚本以将特定文件移动到不同的位置?
- python - 无法正确使用此 while 循环
- python - 在 Osmnx 中使用未简化网络时的绘图错误
- python - 如何授予将消息发送到不同 AWS 账户中的 SQS 队列的权限?
- angular7-router - Angular 7路由忽略路径
- angular - 如何测试角度材料日期选择器?
- python - Python日期顺序错误