Commit 84825d99e7eeb379a6c599cfc7ed141a7a12c1e6

Authored by ww
1 parent 6ad91962

perf: 优化筛选过滤器类别徽标

1 <script lang="ts" setup> 1 <script lang="ts" setup>
  2 + import { Badge } from 'ant-design-vue';
2 import { cloneDeep } from 'lodash'; 3 import { cloneDeep } from 'lodash';
3 import { computed, ref, unref } from 'vue'; 4 import { computed, ref, unref } from 'vue';
4 import { allComponents } from '../../../packages'; 5 import { allComponents } from '../../../packages';
@@ -27,13 +28,21 @@ @@ -27,13 +28,21 @@
27 <template> 28 <template>
28 <section class="absolute top-11 w-full flex flex-auto h-[calc(100%-2.75rem)] bg-neutral-100"> 29 <section class="absolute top-11 w-full flex flex-auto h-[calc(100%-2.75rem)] bg-neutral-100">
29 <nav class="w-20 min-w-20 p-2 border-t border-light-50"> 30 <nav class="w-20 min-w-20 p-2 border-t border-light-50">
30 - <CategoryItem 31 + <Badge
31 v-for="category in allComponents" 32 v-for="category in allComponents"
32 :key="category.category.category" 33 :key="category.category.category"
33 - v-model:activeKey="activeKey"  
34 - :category="category"  
35 - /> 34 + :dot="!!searchText &&
  35 + category.components.some((item) =>
  36 + item.name.toUpperCase().includes(searchText!.toUpperCase())
  37 + )
  38 + "
  39 + :offset="[-10, 10]"
  40 + class="!block"
  41 + >
  42 + <CategoryItem v-model:activeKey="activeKey" :category="category" />
  43 + </Badge>
36 </nav> 44 </nav>
  45 +
37 <body class="p-4 w-full flex flex-col gap-2 items-center overflow-x-hidden overflow-y-auto"> 46 <body class="p-4 w-full flex flex-col gap-2 items-center overflow-x-hidden overflow-y-auto">
38 <NodeItem 47 <NodeItem
39 v-for="config in getCurrentCategoryNode.components" 48 v-for="config in getCurrentCategoryNode.components"