Commit a6c26ec8 authored by youjie's avatar youjie

修复 iframe 缓存机制

parent 74bd9d8e
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
</el-tooltip> </el-tooltip>
</div> </div>
</div> </div>
<iframe name="myTemplateUrl" :src="Url" <iframe id="myTemplateUrl" name="myTemplateUrl" :src="Url"
class="TemplateIframe"> class="TemplateIframe">
</iframe> </iframe>
</div> </div>
...@@ -42,9 +42,14 @@ ...@@ -42,9 +42,14 @@
}, },
}, },
mounted() { mounted() {
window.onload = function () {
onloadIfram()
}
}, },
methods: { methods: {
onloadIfram() {
document.getElementById('#myTemplateUrl').contentWindow.location.reload();
},
close() { close() {
this.$emit('close') this.$emit('close')
} }
......
...@@ -295,6 +295,10 @@ ...@@ -295,6 +295,10 @@
}, },
methods: { methods: {
// 更新 iframe
onloadIfram() {
document.getElementById('#myTemplateUrl').contentWindow.location.reload();
},
closeIframe() { closeIframe() {
this.dialogPptistVisible = false this.dialogPptistVisible = false
}, },
...@@ -663,6 +667,9 @@ ...@@ -663,6 +667,9 @@
if (document.all.myIframe) { if (document.all.myIframe) {
document.all.myIframe.src = this.myIframeUrl + `&t=${new Date().getTime()}` document.all.myIframe.src = this.myIframeUrl + `&t=${new Date().getTime()}`
} }
window.onload = function () {
onloadIfram()
}
}, },
watch: { watch: {
dataAll: { dataAll: {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment