浏览代码

试卷预览图片展示调整

zhangjie 3 年之前
父节点
当前提交
fa0d9cd464
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      src/features/examwork/StudentExamDetail/spins/renderJSON.js

+ 2 - 2
src/features/examwork/StudentExamDetail/spins/renderJSON.js

@@ -101,8 +101,8 @@ function renderBlock(block, inline) {
     if (block.latex) node.dataset.latex = block.latex;
     if (block.latex) node.dataset.latex = block.latex;
     // param
     // param
     if (block.param) {
     if (block.param) {
-      node.style.width = block.param.width;
-      node.style.height = block.param.height;
+      if (block.param.width) node.style.width = block.param.width + "px";
+      if (block.param.height) node.style.height = block.param.height + "px";
     }
     }
   } else if (block.type === "cloze") {
   } else if (block.type === "cloze") {
     node = document.createElement("img");
     node = document.createElement("img");