From 1a5b2a6443dc24e3e024e2c0bb500d80a2b20d11 Mon Sep 17 00:00:00 2001 From: 杨磊 <505174330@qq.com> Date: 星期四, 06 六月 2024 15:36:37 +0800 Subject: [PATCH] Merge branch 'master' of http://182.92.203.7:2001/r/TCM_CharacterLibrary --- 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