From 5c85e86b80388d934233f180498290b0c366515e Mon Sep 17 00:00:00 2001 From: fofolee Date: Fri, 29 Apr 2022 17:27:06 +0800 Subject: [PATCH] =?UTF-8?q?frame=E9=AB=98=E5=BA=A6=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/ResultArea.vue | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/components/ResultArea.vue b/src/components/ResultArea.vue index a04ad3b..1d79685 100644 --- a/src/components/ResultArea.vue +++ b/src/components/ResultArea.vue @@ -58,7 +58,6 @@ export default { enableHtml: Boolean, runResultStatus: Boolean, runResult: Object, - maxHeight: Number, frameInitHeight: Number, }, computed: { @@ -68,7 +67,7 @@ export default { src() { return this.showFrame ? window.URL.createObjectURL( - new Blob([this.frameStyle, this.runResult], { + new Blob([this.frameStyle].concat(this.runResult), { type: "text/html", }) ) @@ -101,12 +100,9 @@ export default { }; Object.assign(cfw, ctx); cfw.onload = () => { - this.frameHeight = Math.min( - cfw.document.body.innerText - ? cfw.document.documentElement.getBoundingClientRect().height - : 0, - this.maxHeight - ); + let clientHeight = + cfw.document.documentElement.getBoundingClientRect().height; + this.frameHeight = clientHeight === 20 ? 0 : clientHeight; this.$emit("frameLoad", this.frameHeight); }; },