@ge-ge/highlight
TypeScript icon, indicating that this package has built-in type declarations

1.0.11 • Public • Published

Overview

使html元素高亮的js库

Options

可选参数

Option Description
theme 自定义class名,用于修改样式

方法

Method params Description
mark() Range 使Range内的元素高亮,返回包含高亮的元素的array
reset() 去除高亮

Usage

npm i @ge-ge/highlight
import Highlight from '@ge-ge/highlight'
 let range = window.getSelection().getRangeAt(0)
 let highlight = new Highlight({theme: 'custom-className'})
 
 highlight.mark(range)

/@ge-ge/highlight/

    Package Sidebar

    Install

    npm i @ge-ge/highlight

    Weekly Downloads

    11

    Version

    1.0.11

    License

    ISC

    Unpacked Size

    57.6 kB

    Total Files

    14

    Last publish

    Collaborators

    • ge-ge