我不知道如何在创建的自定义印迹上添加工具提示。类似于链接上 native 发生的事情
我的自定义印迹显示在带有 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/