소스 검색

句子拆分 单列铺满

natasha 2 년 전
부모
커밋
78ce742be5
1개의 변경된 파일13개의 추가작업 그리고 7개의 파일을 삭제
  1. 13 7
      src/components/Adult/preview/SentenceModule.vue

+ 13 - 7
src/components/Adult/preview/SentenceModule.vue

@@ -62,7 +62,7 @@
           <div
             :class="[
               'sent-option-items',
-              itemsWidth == 748 ? 'sent-option-items-0' : 'sent-option-items-8',
+              itemsWidth == 780 ? 'sent-option-items-0' : 'sent-option-items-8',
             ]"
             v-for="(items, indexs) in userErrorList"
             :key="'sent-option-items' + judgeAnswer + indexs"
@@ -70,7 +70,7 @@
               width:
                 curQue.sortType == 'col'
                   ? itemsWidth + 'px'
-                  : Math.floor(748 / curQue.option.length) - 24 + 'px',
+                  : Math.floor(780 / curQue.option.length) - 16 + 'px',
             }"
           >
             <div
@@ -434,12 +434,13 @@
           <div
             :class="[
               'sent-option-items',
-              itemsWidth == 748 ? 'sent-option-items-0' : 'sent-option-items-8',
+              itemsWidth == 780 ? 'sent-option-items-0' : 'sent-option-items-8',
             ]"
             v-for="(items, indexs) in item"
             :key="'sent-option-items' + index + indexs"
             :style="{
               width: curQue.sortType == 'col' ? itemsWidth + 'px' : '100%',
+
             }"
           >
             <div
@@ -1166,11 +1167,16 @@ export default {
       }
 
       this.$set(this.curQue, "option", option);
-      let contentWidth = 748;
+      let contentWidth = 780;
       if (this.curQue.img_list && this.curQue.img_list.length > 0) {
-        contentWidth = 748 - this.curQue.img_size;
+        contentWidth = 780 - this.curQue.img_size;
+      }
+      if(itemLeg==1){
+        this.itemsWidth = 780
+      }else{
+        this.itemsWidth = Math.floor(contentWidth / itemLeg) - 16;
       }
-      this.itemsWidth = Math.floor(contentWidth / itemLeg) - 24;
+      
 
       // 把答错的挑出来
       if (this.judgeAnswer == "standardAnswer") {
@@ -1470,7 +1476,7 @@ export default {
         margin: 0px;
         .sent-option-items {
           &-0 {
-            margin: 0;
+            margin: 8px 0; // 单列左右间距去掉
           }
           &-8 {
             margin-left: 8px;