Jelajahi Sumber

名医名方/疾病查询 tabs 溢出滚动

cc12458 6 bulan lalu
induk
melakukan
81a74e533e
1 mengubah file dengan 13 tambahan dan 2 penghapusan
  1. 13 2
      src/views/knowledge/Disease.vue

+ 13 - 2
src/views/knowledge/Disease.vue

@@ -34,7 +34,7 @@
             <!-- 顶部tab -->
             <div class="p-tab flex-vertical-center-l">
                 <div :class="tab_current==index?'flex-center p-active':'flex-center'" v-for="(item,index) in tabs"
-                    :key="index" @click="tabCahnge(index)">
+                    :key="index" @click="tabCahnge(index);scroll($event)">
                     {{item.deptName}}
                 </div>
 
@@ -93,6 +93,9 @@
                 this.tab_current = index
                 this.getDiseaseList()
             },
+            scroll(event) {
+              try { event.target.scrollIntoView({ behavior: 'smooth', inline: 'center' }); } catch (e) {}
+            },
             loadMoreData() {
                 this.getDiseaseList(this.loadMore)
             },
@@ -159,7 +162,15 @@
 
         .prescr-body {
             margin-top: 10px;
-
+            .p-tab {
+              flex-wrap: nowrap;
+              overflow-x: auto;
+              > div {
+                flex-shrink: 0;
+                min-width: 70px;
+                width: auto;
+              }
+            }
         }
 
         .table-data {