How to use formula in vue-quill-editor?
See original GitHub issueI’m trying to use vue-quill-editor in my project, which is a webpack project. After I mount it as a component, everything looks well, but the formula button is not shown. I checked the document of quill, it said:
Formula - formula (requires KaTex)
So I import KaTex in a vue file like this:
import "quill/dist/quill.core.css";
import "quill/dist/quill.snow.css";
import "quill/dist/quill.bubble.css";
import { quillEditor } from "vue-quill-editor";
import "katex/dist/katex.js";
However, it still not work.
I try add “formula” option like this:
editorOption: {
modules: {
toolbar: [
["bold", "italic", "underline", "strike"],
[{ list: "ordered" }, { list: "bullet" }],
[{ color: [] }, { background: [] }],
[{ align: [] }],
["image"],
["formula"]
]
}
},
The button of formula is shown, but it isn’t work correctly. And the error report:
Uncaught TypeError: Cannot read property 'render' of undefined
at Function.create (quill.js:10926)
at Object.create (quill.js:183)
at Block.ContainerBlot.insertAt (quill.js:3407)
at BlockBlot.insertAt (quill.js:7406)
at Block.insertAt (quill.js:855)
at Scroll.ContainerBlot.insertAt (quill.js:3404)
at ScrollBlot.insertAt (quill.js:7145)
at Scroll.insertAt (quill.js:4252)
at Editor.insertEmbed (quill.js:2606)
at quill.js:1379
Issue Analytics
- State:
- Created 5 years ago
- Comments:10
Top Results From Across the Web
API - Quill Rich Text Editor
Quill is a free, open source WYSIWYG editor built for the modern web. Completely customize it for any need with its modular architecture...
Read more >vue-quill-editor | Homepage
Think of headless browsers as a browser that you can run from the command line that can retrieve and traverse web pages. The...
Read more >How to use Quill text editor as a component in Vue.js
Even though you tagged the question as a Vue 2 question, I am going to guess you are using Vue 3 because otherwise,...
Read more >A text editor using Vue.js and Quill
Props ; id, String, quill-container, Set the id (necessary if multiple editors in the same view) ; v-model, String, -, Set v-model to...
Read more >MathQuill: Easily type math into your webapp
You Use MathQuill? Partner with us so we can work more closely with you! About. MathQuill is an open source formula editor for...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I found solution about this issue.
Add few lines to import katex module to component file.
And add below lines to ‘mounted’ methods.
Thanks, it works perfectly!