admin 管理员组文章数量: 1086019
Assuming I created an editor instance for a certain element, e.g. via const editor = new Quill('#editor', {...some options});
Now, I would like to get this editor instance when only having the element available, e.g. something like const editor = Quill.existingEditorFromElement('#editor');
The reason is that I am building a ponent that can be plugged into existing websites that enhances their editors, and I need a way to get their editor instance.
Assuming I created an editor instance for a certain element, e.g. via const editor = new Quill('#editor', {...some options});
Now, I would like to get this editor instance when only having the element available, e.g. something like const editor = Quill.existingEditorFromElement('#editor');
The reason is that I am building a ponent that can be plugged into existing websites that enhances their editors, and I need a way to get their editor instance.
Share Improve this question asked Nov 4, 2020 at 18:44 Daniel HilgarthDaniel Hilgarth 174k40 gold badges344 silver badges449 bronze badges 1- Possible duplicate of stackoverflow./questions/41673629/… – Stephen Murumba Commented Feb 9, 2024 at 17:34
2 Answers
Reset to default 7According to Quill API Documentation you can get the editor instance by getting the DOM element by its ID (or classname or tagname...), and inserting it inside the find function.
Example:
var div = document.getElementById('editor');
var quill_instance = Quill.find(div);
This can be done by using Quill.find('#editor');
, see https://quilljs./docs/api/#find-experimental
本文标签: javascriptGet Quill editor instance from HTML elementStack Overflow
版权声明:本文标题:javascript - Get Quill editor instance from HTML element - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.roclinux.cn/p/1744023725a2520260.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论