vue3-highlight-text
TypeScript icon, indicating that this package has built-in type declarations

1.0.7 • Public • Published

Vue3 Highlight Text

a vue3 directive of highlight text

Installation

npm install --save vue3-highlight-text
or
yarn add --save vue3-highlight-text

Quick Start

// vue project main file
import HighlightText from 'vue3-highlight-text'

app.directive('highlight', HighlightText({
  mode?: string,
  color?: string
}))
<template>
  <div>
    <span v-highlight="{
      mode?: string,
      color?: string,
      className?: string,
      content?: string,
      keyword: string
    }">
  </div>
</tempalte>

If not use content property, the innerText of the directive wrapper will be as content.

<template>
  <div>
    <span v-highlight="{ keyword: string }">innerText</span>
  </div>
</tempalte>

Readme

Keywords

Package Sidebar

Install

npm i vue3-highlight-text

Weekly Downloads

1,650

Version

1.0.7

License

MIT

Unpacked Size

3.37 kB

Total Files

6

Last publish

Collaborators

  • wiensss