From 8266ec666c5cccd6e9623928eea4fcc2bcd61517 Mon Sep 17 00:00:00 2001 From: 刘有才luck <14606842+liu-youcai-luck@user.noreply.gitee.com> Date: Mon, 9 Dec 2024 15:31:04 +0800 Subject: [PATCH] wip: bug修复 --- src/views/basic/askTestQuestion/wrongQuestion.vue | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/views/basic/askTestQuestion/wrongQuestion.vue b/src/views/basic/askTestQuestion/wrongQuestion.vue index 52ad3f0..17be1cf 100644 --- a/src/views/basic/askTestQuestion/wrongQuestion.vue +++ b/src/views/basic/askTestQuestion/wrongQuestion.vue @@ -658,23 +658,23 @@ export default { // let a = this.processString(firstP.innerHTML); // firstP.innerHTML = a; // } - // const doc = iframeRef.contentDocument || iframeRef.contentWindow.document; - // const body = iframeRef.contentWindow.document.body; - // body.style.overflowX = "hidden"; // 不允许出现横向滚动条 - // const height = body.offsetHeight; // 获取内容的高度 - // console.log(height, "height"); - // // console.log("body.offsetHeight:", body.offsetHeight); - // // console.log("body.clientHeight:", body.clientHeight); - // // console.log("body.scrollHeight:", body.scrollHeight); - - // iframeRef.style.height = `${height + 20}px`; // 设置 iframe 的高度 - // // 获取第一个P标签 - // const firstP = doc.getElementsByTagName("p")[0]; - // // 或者修改第一个 < p > 标签的内容; - // if (firstP) { - // let a = this.processString(firstP.innerHTML); - // firstP.innerHTML = a; - // } + const doc = iframeRef.contentDocument || iframeRef.contentWindow.document; + const body = iframeRef.contentWindow.document.body; + body.style.overflowX = "hidden"; // 不允许出现横向滚动条 + const height = body.offsetHeight; // 获取内容的高度 + console.log(height, "height"); + // console.log("body.offsetHeight:", body.offsetHeight); + // console.log("body.clientHeight:", body.clientHeight); + // console.log("body.scrollHeight:", body.scrollHeight); + + iframeRef.style.height = `${height + 20}px`; // 设置 iframe 的高度 + // 获取第一个P标签 + const firstP = doc.getElementsByTagName("p")[0]; + // 或者修改第一个 < p > 标签的内容; + if (firstP) { + let a = this.processString(firstP.innerHTML); + firstP.innerHTML = a; + } }, // 子集删除后 父级需要更新 -- libgit2 0.21.4