1

I'd like to be able to extend native blots as seen in cloning medium w/ parchment. I am using angular2 with typescript, and typescript does not believe that BlockEmbed is a real constructor.

Using the following code (pretty much directly from above tutorial): let BlockEmbed = Quill.import('blots/block/embed');

class DividerBlot extends BlockEmbed { }
DividerBlot.blotName = 'divider';
DividerBlot.tagName = 'hr';
4

1 回答 1

0

像这样的东西对我有用:

const BlockEmbed = Quill.import('blots/block/embed') as { new (node, value): Object };
export class DividerBlot extends BlockEmbed {
    static blotName = 'divider';
    static tagName = 'hr';
}
于 2017-03-22T14:29:12.387 回答