From 78d8475793f479479961e403f7a71407eff06735 Mon Sep 17 00:00:00 2001 From: 刘有才luck <14606842+liu-youcai-luck@user.noreply.gitee.com> Date: Mon, 9 Dec 2024 15:20:30 +0800 Subject: [PATCH] wip: bug修复 --- src/views/basic/askTestQuestion/wrongQuestion.vue | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/src/views/basic/askTestQuestion/wrongQuestion.vue b/src/views/basic/askTestQuestion/wrongQuestion.vue index 1f0020f..52ad3f0 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; + // } }, // 子集删除后 父级需要更新 @@ -700,7 +700,7 @@ export default { const parts = num.toString().split("."); if (parts.length === 2 && parts[1].length > 2) { // 如果小数部分超过两位,保留两位小数 - return parseFloat(num.toFixed(2)); + return Math.round(num * 100) / 100; } else { // 否则返回原数据 return num; -- libgit2 0.21.4