爱意满满的作品展示区。
johnnyNg

分享一个前端点击文章取英语单词以及单词位置的 npm 包

  •  
  •   johnnyNg · Mar 13, 2019 · 2564 views
    This topic created in 2628 days ago, the information mentioned may be changed or developed.

    之前在一家英语阅读的公司做了一阵子前端,帮忙解决了点击取词的问题,然后在 npm 发了个包,这么长时间了突然想起来分享一下,点击取词有很多实现方式,之前分析过扇贝的,他们用的是把一篇文章的所有单词拆出来,优势就是可控性高,可以取到词组,我的这个实现很简单,主要依赖 js range api,使用起来也很简单,缺点就是不支持词组。

    https://github.com/johnny19941216/theword

    实现上面效果的代码

    1 replies    2019-03-14 13:31:27 +08:00
    fredjacson
        1
    fredjacson  
       Mar 14, 2019
    支持,有空看一下
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2841 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 54ms · UTC 14:55 · PVG 22:55 · LAX 07:55 · JFK 10:55
    ♥ Do have faith in what you're doing.