javascript - 如何在 EXTJS 中自动重新加载框架?
问题描述
iframe
我在 EXTJS 中有一个组件,我在其中加载外部 html 文件:
{
xtype: "component",
border: false,
layout: 'fit',
flex: 1,
autoEl: {
width: '100%',
height: '100%',
tag: "iframe",
src: 'resources/startpage/index.html'
}
}
我希望 iframe 在我更改外部 html 文件时自动加载新内容,但它会加载缓存中的先前文件。有没有办法做到这一点?
通过类比图像文件,我试图把
src: 'resources/startpage/index.html' + '?_dc=' + (new Date())*1
但这不起作用,
解决方案
您是否尝试将其绑定到视图模型
视图.js
{
xtype: 'container',
bind: {
html: '<iframe src="resources/startpage/index.html?_dc={myDc}" style="width: 100%; height: 100%; border: none;"/>'
}
}
视图模型.js
formulas: {
myDc: {
get(){
return (new Date())*1;
}
}
}
推荐阅读
- download - “下载构建工件”实际上是做什么的?
- docker - 配置、扩展 Grafana Docker 容器
- php - laravel 5.7.15 419 抱歉,您的会话已过期。请刷新并重试
- ios - Xamarin iOS 故事板拉伸对象
- python - 如何爬取Goodreads并获取数据
- bash - 启动新的 mac 终端窗口时出现意外的 -bash 命令未找到错误
- scala - 如何将 Apache Spark 日志从驱动程序和从属设备重定向到使用 log4j 启动 Spark 作业的机器的控制台?
- angular - Angular 服务全局注入
- c# - 如何使用 .NET NEST 客户端在函数评分查询中创建过滤器
- java - Tomcat - 删除临时和工作目录解决了类路径问题 - 但为什么呢?