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

问题描述 投票:2回答:1

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

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>
quill
1个回答
0
投票

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

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

© www.soinside.com 2019 - 2024. All rights reserved.