UI Components > Rich Text Editing


vue-highlight-text 2.27


🔦 Vue component for highlight multiple instances of a word
  • highlight
  • search
  • vue
  • vue_highlight_text
last commit 2 years ago
55
Stargazers

Watchers
55
Open issues
1
73186
Downloads

Last 30 days
3033
Releases
5
47
Final Score

Quality
86
Popularity
10
Maintenance
50

vue-highlight-text

NPM version NPM downloads Build Status

Vue component for highlight multiple instances of a word

Installation

# with yarn
yarn add vue-highlight-text

# with npm
npm install --save vue-highlight-text

Use component

import Vue from 'vue';
import HighlightText from 'vue-highlight-text';

Vue.component('HighlightText', HighlightText);

Use directive

import Vue from 'vue';
import highlight from 'vue-highlight-text/public/directive.min.js';

Vue.directive('highlight', highlight);

In file vue

<!-- component -->
<HighlightText :keyword="keyword" :sensitive="sensitive">{{msg}}</HighlightText>
<!-- Directive -->
<span v-highlight="{keyword: keyword}">{{msg}}</span>

Props or value of directive

Name Type Default Description
keyword string '' word for highlight in message.
sensitive bool true highlight with case sensitive
overWriteStyle Object {color: '#00C1E8'} custom highlight for overwrite style by HTML DOM Style Object