Quill 羽毛笔在自定义斑点上添加工具提示
我不知道如何在创建的自定义污点上添加工具提示。类似于链接上本地发生的事情 我的自定义污点显示在带有cusom标记的文本编辑器中Quill 羽毛笔在自定义斑点上添加工具提示,quill,Quill,我不知道如何在创建的自定义污点上添加工具提示。类似于链接上本地发生的事情 我的自定义污点显示在带有cusom标记的文本编辑器中 class CustomBlot extends BlockEmbed { static create(value) { let node = super.create(); node.setAttribute('object', "instrument"); node
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);
class CustomBlot扩展了BlockEmbed{
静态创建(值){
让node=super.create();
node.setAttribute('object','instrument');
node.setAttribute('id',value.id);
node.innerHTML=`
${value.name}
`;
返回节点;
}
静态格式(节点){
返回node.getAttribute('id');
}
}
CustomBlot.blottname='custom';
CustomBlot.tagName='我的自定义标记';
羽毛套准器(定制印记);
因此,在我的编辑器中插入的代码位于这些标记之间
<my-custom-tag>some html</my-custom-tag>
一些html
我知道这已经有一段时间了,但对于任何对该主题感兴趣的人,请参见以下链接: