Files
Bram eb1c1c613e All workspaces homepage [5/7] All workspaces sort functionality (#6002)
* Added sort to all workspaces homepage and remember preference

* Fixed feedback

* Fixed migration conflict

* Fixed feedback
2026-09-25 13:04:06 +02:00

35 lines
696 B
Vue

<template>
<span class="search-highlight">
<template v-for="(segment, index) in segments" :key="index">
<mark v-if="segment.matched" class="search-highlight__match">{{
segment.text
}}</mark>
<template v-else>{{ segment.text }}</template>
</template>
</span>
</template>
<script>
import { splitHighlight } from '@baserow/modules/core/utils/search'
export default {
name: 'SearchHighlight',
props: {
text: {
type: String,
required: true,
},
query: {
type: String,
required: false,
default: '',
},
},
computed: {
segments() {
return splitHighlight(this.text, this.query)
},
},
}
</script>