最近发现一个特别好玩的 JavaScript 库,叫 RoughNotation
。
干嘛用的呢?就是在网页上给文字加标注,比如下划线、方框、高亮文字背景等,不过是手写风格的!
如何使用
npm install --save rough-notation
如何用
import { annotate } from 'rough-notation';
const e = document.querySelector('#myElement');
const annotation = annotate(e, { type: 'underline' });
annotation.show();
效果图

更多语法 参照github
网友评论