diff --git a/src/views/main-content.vue b/src/views/main-content.vue index cb671df25..5c44fe504 100644 --- a/src/views/main-content.vue +++ b/src/views/main-content.vue @@ -129,13 +129,15 @@ export default { if (!from) { return } - console.log(this.$store.state.contentTabs); if (from.path == "/main/i-1672924097874173953") { let iframes = document.querySelector("#iframes") - iframes.src = 'about:blank'; - iframes.contentWindow.document.write(''); - iframes.contentWindow.document.close(); - iframes.parentNode.removeChild(iframes); + console.log(iframes, 97998); + if (iframes) { + iframes.src = 'about:blank'; + iframes.contentWindow.document.write(''); + iframes.contentWindow.document.close(); + iframes.parentNode.removeChild(iframes); + } } if (to.path == "/main/i-1672924097874173953") { let url; @@ -146,9 +148,10 @@ export default { }) let iframe = document.createElement('iframe'); iframe.src = url + this.urlTokenSymbol + 'token=' + this.token + '&customerId=' + this.customerId; - iframe.unselectable = "on"; - iframe.name = "container"; - iframe.id = "iframes"; + iframe.frameborder = "0" + iframe.id = "iframes" + iframe.height = "100%" + iframe.width = "100%" //添加到原来的iframe位置 if (document.querySelector("#iframeBox")) { document.querySelector("#iframeBox").appendChild(iframe); @@ -332,7 +335,7 @@ export default { overflow: hidden; } #iframeBox { - width: "100%"; - height: "100%"; + width: 100%; + height: 100%; }