Răsfoiți Sursa

Merge branch 'dev/v1.2.16_wmh' of jianyu/jy-docs into feature/v1.2.16

wenmenghao 9 luni în urmă
părinte
comite
498fd4dc36
1 a modificat fișierele cu 3 adăugiri și 3 ștergeri
  1. 3 3
      jydocs-pc/src/components/SelectedRecommend.vue

+ 3 - 3
jydocs-pc/src/components/SelectedRecommend.vue

@@ -75,15 +75,15 @@ export default {
       this.$emit('click', item)
     },
     setItemwidth () { // 适配嵌入工作台内
-      const bodyWidth = window.screen.width - 212
+      const bodyWidth = window.screen.width - 212 - 8
       if (window.goTemplateData && window.goTemplateData.inIframe && bodyWidth > 1248) {
         const itemwidth = 279 + 104 // 104是margin
         const num = Math.floor((bodyWidth - 96) / itemwidth)
-        const newwidth = ((Math.floor((bodyWidth - (itemwidth * num) - 96) / num)) + itemwidth) - 104
+        console.log(num)
+        const newwidth = (Math.floor((bodyWidth - 96 - (itemwidth * num)) / num)) + 279
         var elements = document.querySelectorAll('.card-item')
         elements.forEach(function (ele) {
           ele.style.width = newwidth + 'px' // 设置新的宽度
-          console.log(ele.style.width)
         })
       }
     }