页面文本高亮工具-lightmon

165 阅读1分钟

lightmon

A tool for highlighting text according to keywords

根据关键字文本高亮的一个工具

image.png

安装

npm install lightmon

使用

import HL from "lightmon";

const hl = new HL({
  // 需要查找关键字的根元素
  root: document.querySelector(".ant-select-dropdown"),
  // style: 'font-weight: bold;',
});

hl.light(keyword);