瀏覽代碼

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

wenmenghao 10 月之前
父節點
當前提交
56ae9bfb99
共有 1 個文件被更改,包括 7 次插入2 次删除
  1. 7 2
      jydocs-pc/src/views/Home.vue

+ 7 - 2
jydocs-pc/src/views/Home.vue

@@ -218,13 +218,18 @@ export default {
       return this.pageData?.hot && this.pageData?.hot.slice(5)
     },
     adHeight () {
-      return vw2px(px2viewport(80, 'vw', {
+      const setheight = vw2px(px2viewport(80, 'vw', {
         viewportWidth: 1224,
         unitPrecision: 3
       }), 'px', {
         viewportWidth: document.body.clientWidth,
         unitPrecision: 3
       })
+      if (setheight === '0px') {
+        return '80px'
+      } else {
+        return setheight
+      }
     }
   },
   methods: {
@@ -347,7 +352,7 @@ export default {
       getSearchTag().then(data => {
         const res = data.data
         if (res && res.error_code === 0) {
-          this.wordModel = res.data.map((item, index) => ({ value: item, active: index === 0 ? true : false }))
+          this.wordModel = res.data.map((item, index) => ({ value: item, active: index === 0 }))
           this.$nextTick(() => {
             this.checkIsOneRow()
           })