羽毛笔在自定义印迹上添加工具提示

标签 quill

我不知道如何在创建的自定义印迹上添加工具提示。类似于链接上 native 发生的事情

enter image description here

我的自定义印迹显示在带有 cusom 标签的文本编辑器中

   class CustomBlot extends BlockEmbed {
          static create(value) {

            let node = super.create();
            node.setAttribute('object', "instrument");
            node.setAttribute('id', value.id);
            node.innerHTML = `
            <div class="btn-group">
              <button class="btn btn-sm btn-outline-info">${value.name}</button>
            </div>
            `;
            return node;
          }

          static formats(node) {
            return node.getAttribute('id');
          }
        }
        CustomBlot.blotName = 'custom';
        CustomBlot.tagName = 'my-custom-tag';
        Quill.register(CustomBlot);

所以在我的编辑器中插入的代码在这些标签之间
<my-custom-tag>some html</my-custom-tag>

最佳答案

我知道这已经有一段时间了,但是对于对该主题感兴趣的任何人,请参阅以下链接:

https://github.com/loagit/Quill-Examples-and-FAQ

关于羽毛笔在自定义印迹上添加工具提示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52900815/

相关文章:

javascript - 完成编辑后如何关闭羽毛笔编辑器

javascript - 如何防止 Quill 在顶部边距为 10px 的标题前插入空白段落 (`<p><br></p>` )?

angular - 使用自定义类中的 Angular MatDialog(不包含在 app.module.ts 中)

quill - 如何将对齐按钮添加到 Quill 的工具栏?

reactjs - React-Quill - 错误你很可能想要 `editor.getContents()`

javascript - 如何在 quill js 2.0 中初始化表?

css - 有没有更好的方法来包含 npm 安装的 CSS 文件?

mysql - Quill - INSERT INTO SELECT... 语法?

Quill:如何获取包含样式的 html 数据?