NcHighlight
Props
Prop name | Description | Type | Values | Default |
---|---|---|---|---|
text | The string to display | string | - | '' |
search | The string to match and highlight | string | - | '' |
highlight | The ranges to highlight, takes precedence over the search prop. | array | - | [] |
General description
Highlight a string with html <strong>. Accepts a substring to highlight or an array with ranges.
Usage
vue
<template>
<div>
<NcHighlight text="Highlight me please!" search="me" />
<br />
<NcHighlight
text="Highlight me please!"
:highlight="[{ start: 4, end: 12 }]"
/>
</div>
</template>