/////我在哪里获取数据
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)
///除非我重定向到另一个页面,否则它将显示错误图像。
答案 0 :(得分:0)
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();
}
}
尝试一下,它会一次重新加载页面,我知道这不是最好的解决方案,但在紧急情况下会有所帮助。