Having problems extending Quill

别等时光非礼了梦想. 提交于 2019-12-05 09:03:21

Figured it out (well a colleague did).

I needed to import Parchment like so :-

let Parchment = Quill.import('parchment');

instead of import Parchment from 'parchment';

This is because you'll end up with a different static Parchment class to the one used internally to Quill, so asking Quill for it's instance ensures you are both working with the same one (ie, the one where the blots were registered).

I came across that problem a couple hours ago.

In Quill's source code, List is a default export while ListItem is a named export.

So your import should look like this:

import List, { ListItem } from './quill/list';

Be sure to export them appropriately on your custom list.js file.

Good luck!

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!