-
[diacriticsSensitive]:
Boolean
Whether string being searched is diacritics sensitive.
-
[highlightComponent]:
Object|String
By default vue-text-highlight uses
<mark>
for the highlighting. Pass this props to override with other tag (string
) or custom component (Vue component definition).This component will be passed with two props from
text-highlight
:-
index:
Number
Index of highlighted component.
-
text:
String
Highlighted words, equals to
this.$slots.default[0].text
-
-
Other props and listeners that are not listed above are forwarded to the highlighted component. These props will be merged with highter precendence with
index
andtext
passed fromtext-highlight
.
In v1, the non-highlighted and highlighted words are wrapped with <span>
. In v2, non-highlighted words are plain string and highlighted words are wrapped with <mark>
.
Update props in TextHighlight
component:
-
queries:
Array<String|RegExp>|String|RegExp
This prop accepts string, regex, and array of strings or regex. If array is given, it will highlight the union of matched strings/regex globally.
Initial release.