1
YM
2024-06-05 f3e5b489e30a921c03ef8b97e1cd845b65ea5d9d
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>