From a7453eea26785a3100b35b9c10000dc202671221 Mon Sep 17 00:00:00 2001
From: YM <479443481@qq.com>
Date: 星期三, 12 六月 2024 18:42:58 +0800
Subject: [PATCH] 1

---
 src/pages/character/index.vue |   21 ++++++++++++++++-----
 1 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/src/pages/character/index.vue b/src/pages/character/index.vue
index fe8ecf5..b7688d7 100644
--- a/src/pages/character/index.vue
+++ b/src/pages/character/index.vue
@@ -19,9 +19,9 @@
       鐑棬鎼滅储锛�
       <ul class="flex" style="margin-right: 10rpx">
         <li
-          @click="onSearch({ text: item })"
-          class="cursor"
-          v-for="item in hotKeyList"
+          @click="onSearch({ text: item }, index)"
+          :class="{ cursor: true, active: hotAciveIndex === index }"
+          v-for="(item, index) in hotKeyList"
           :key="item"
         >
           {{ item }}
@@ -106,6 +106,7 @@
   data() {
     return {
       loading: true,
+      hotAciveIndex: "",
       // echarts鏁版嵁
       nodes: [],
       // echarts涓よ�呯殑鍏崇郴
@@ -171,7 +172,7 @@
           },
           {
             type: "input",
-            label: "鏃堕棿",
+            label: "鏃舵湡",
             name: "period",
             value: ""
           },
@@ -483,7 +484,13 @@
       option && myChart.setOption(option);
     },
     // 鍩虹鎼滅储
-    onSearch(val) {
+    onSearch(val, index) {
+      if (index !== undefined) {
+        this.searchKey = "";
+        this.hotAciveIndex = index;
+      } else {
+        this.hotAciveIndex = "";
+      }
       // this.searchKey = val.text;
       this.getData(val.text);
     },
@@ -593,6 +600,10 @@
     color: #244a7b;
     margin: 0 0.1rem;
     color: #244a7b;
+    &.active{
+      color: #027EDC;
+      font-weight: bold;
+    }
   }
 }
 </style>

--
Gitblit v1.9.1