如何在 EXTJS 中自动重新加载框架?
How to automatically reload frame in EXTJS?
我在 EXTJS 中有一个 iframe
组件,我在其中加载外部 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
但这不起作用,
您是否尝试将其绑定到视图模型
view.js
{
xtype: 'container',
bind: {
html: '<iframe src="resources/startpage/index.html?_dc={myDc}" style="width: 100%; height: 100%; border: none;"/>'
}
}
viewmodel.js
formulas: {
myDc: {
get(){
return (new Date())*1;
}
}
}
我在 EXTJS 中有一个 iframe
组件,我在其中加载外部 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
但这不起作用,
您是否尝试将其绑定到视图模型
view.js
{
xtype: 'container',
bind: {
html: '<iframe src="resources/startpage/index.html?_dc={myDc}" style="width: 100%; height: 100%; border: none;"/>'
}
}
viewmodel.js
formulas: {
myDc: {
get(){
return (new Date())*1;
}
}
}