我尝试在Quill中创建自定义样式代理,以使用内联样式进行缩进。到目前为止,我所有的一切都是最低限度的:
class Indent extends Parchment.Attributor.Style {}
const IndentStyle = new Indent('indent', 'margin-left', {
scope: Parchment.Scope.BLOCK
});
Quill.register(IndentStyle, true);
但是,当我尝试通过工具栏按钮应用缩进格式时,我在控制台中收到此错误:
ERROR TypeError: BlotClass.create is not a function
at Object.create (quill.js:184)
at Block.ShadowBlot.replaceWith (quill.js:5200)
at Block.FormatBlot.replaceWith (quill.js:3610)
at Block.FormatBlot.format (quill.js:3597)
at BlockBlot.format (quill.js:7250)
at eval (quill.js:2513)
at Array.forEach (<anonymous>)
at eval (quill.js:2510)
at Array.forEach (<anonymous>)
at Editor.formatLine (quill.js:2506)
知道我在这里做错了吗?