Переглянути джерело

句子拆分模版有图片情况下计算宽度

natasha 1 місяць тому
батько
коміт
36c4c0da63

+ 5 - 1
src/components/Adult/preview/SentenceModule.vue

@@ -1223,7 +1223,11 @@ export default {
       if (this.curQue.img_list && this.curQue.img_list.length > 0) {
       if (this.curQue.img_list && this.curQue.img_list.length > 0) {
         contentWidth = 780 - this.curQue.img_size;
         contentWidth = 780 - this.curQue.img_size;
       }
       }
-      if (itemLeg == 1) {
+      if (
+        itemLeg == 1 &&
+        this.curQue.img_list &&
+        this.curQue.img_list.length === 0
+      ) {
         this.itemsWidth = 780;
         this.itemsWidth = 780;
       } else {
       } else {
         this.itemsWidth = Math.floor(contentWidth / itemLeg) - 16;
         this.itemsWidth = Math.floor(contentWidth / itemLeg) - 16;

+ 5 - 1
src/components/Adult/preview/SentenceMulModule.vue

@@ -1357,7 +1357,11 @@ export default {
       if (this.curQue.img_list && this.curQue.img_list.length > 0) {
       if (this.curQue.img_list && this.curQue.img_list.length > 0) {
         contentWidth = 780 - this.curQue.img_size;
         contentWidth = 780 - this.curQue.img_size;
       }
       }
-      if (itemLeg == 1) {
+      if (
+        itemLeg == 1 &&
+        this.curQue.img_list &&
+        this.curQue.img_list.length === 0
+      ) {
         this.itemsWidth = 780;
         this.itemsWidth = 780;
       } else {
       } else {
         this.itemsWidth = Math.floor(contentWidth / itemLeg) - 16;
         this.itemsWidth = Math.floor(contentWidth / itemLeg) - 16;