Line data Source code
1 : <template>
2 18441 : <template v-for="(part, index) in highlightQuery(text, query)" :key="index">
3 : <span v-if="part.highlighted" :class="cn('highlight', highlightClass)">{{
4 : part.text
5 : }}</span>
6 : <template v-else>{{ part.text }}</template>
7 : </template>
8 : </template>
9 :
10 : <script setup lang="ts">
11 : import { cn } from '@comfyorg/tailwind-utils'
12 :
13 : import { highlightQuery } from './highlightQuery'
14 :
15 : const { text, query, highlightClass } = defineProps<{
16 : query: string
17 : text: string
18 : highlightClass?: string
19 : }>()
20 : </script>
|