toHighlight API
Splits text into matched and unmatched chunks, returning a plain
HighlightChunk[] for search-term highlighting.Related
Explore these related pages for additional context and usage patterns.
| Page | Category |
|---|---|
| To Highlight | Transformers |
| createFilter | Data |
| Combobox | Forms |
| To Array | Transformers |
Functions
toHighlight
(text: MaybeRefOrGetter<string>, query?: MaybeRefOrGetter<string | string[] | undefined>, options?: ToHighlightOptions) => HighlightChunk[]Splits text into matched and unmatched chunks.
Pure transformer — returns a plain array. Wrap the call in computed() for
reactive recomputation.
Priority: options.matches (when non-empty) → query → no-match fallback.