From d6436978d8b6f2039b6ef797f77fe4de38e6a0ed Mon Sep 17 00:00:00 2001
From: 杨磊 <505174330@qq.com>
Date: 星期四, 06 六月 2024 15:36:31 +0800
Subject: [PATCH] bug修改

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

diff --git a/src/pages/character/index.vue b/src/pages/character/index.vue
index fe8ecf5..0055b31 100644
--- a/src/pages/character/index.vue
+++ b/src/pages/character/index.vue
@@ -19,9 +19,10 @@
       鐑棬鎼滅储锛�
       <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 }"
+          hotAciveIndex
+          v-for="(item, index) in hotKeyList"
           :key="item"
         >
           {{ item }}
@@ -106,6 +107,7 @@
   data() {
     return {
       loading: true,
+      hotAciveIndex: "",
       // echarts鏁版嵁
       nodes: [],
       // echarts涓よ�呯殑鍏崇郴
@@ -483,7 +485,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 +601,10 @@
     color: #244a7b;
     margin: 0 0.1rem;
     color: #244a7b;
+    &.active{
+      color: #027EDC;
+      font-weight: bold;
+    }
   }
 }
 </style>

--
Gitblit v1.9.1