V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
ollinscarryleel
V2EX  ›  前端开发

帅哥们,求指导, Monaco 编辑器,怎么实现马克笔效果?

  •  1
     
  •   ollinscarryleel · 198 天前 · 424 次点击
    这是一个创建于 198 天前的主题,其中的信息可能已经有所发展或是发生改变。
    ollinscarryleel
        1
    ollinscarryleel  
    OP
       198 天前


    未选择状态下,需要这种效果
    ollinscarryleel
        2
    ollinscarryleel  
    OP
       195 天前
    解决办法
    ```
    var decorations = editor.createDecorationsCollection([
    {
    range: new monaco.Range(7, 1, 7, 24),
    options: { inlineClassName: "自定义 Range 范围的 class 样式名称" },
    },
    ]);
    ```
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1148 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 18:21 · PVG 02:21 · LAX 11:21 · JFK 14:21
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.