Przeglądaj źródła

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

cc12458 6 miesięcy temu
rodzic
commit
81a74e533e
1 zmienionych plików z 13 dodań i 2 usunięć
  1. 13 2
      src/views/knowledge/Disease.vue

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

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