Просмотр исходного кода

试卷预览图片展示调整

zhangjie 3 лет назад
Родитель
Сommit
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;
     // 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") {
     node = document.createElement("img");