I am using Vue 3 and the package vueup/vue-quill for rich text editing. In the template, I do this:
<QuillEditor :toolbar="toolbar" :modules="modules"/>
Here is the script code:
import { QuillEditor } from '@vueup/vue-quill';
import 'quill/dist/quill.core.css';
import 'quill/dist/quill.snow.css';
import 'quill/dist/quill.bubble.css';
import 'quill-better-table/dist/quill-better-table.css';
import QuillBetterTable from 'quill-better-table';
export default defineComponent({
components: {
QuillEditor,
},
setup() {
const toolbar = [
['bold', 'italic', 'underline'],
[{ 'list': 'ordered' }, { 'list': 'bullet' }],
['link', 'image'],
[{ 'table': true }], // Table button
['clean'],
];
const modules = [
{
name: 'blotFormatter',
module: BlotFormatter,
options: {/* options */}
},
{
name: 'better-table',
module: QuillBetterTable,
options: {
operationMenu: {
items: {
unmergeCells: {
text: 'Unmerge cells'
}
}
}
}
}
];
return {
modules, toolbar
}
}
});
As soon as the ‘better-table’ module is added, I get this error:
quill-better-table.js?v=ed9bacc4:2583 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading ‘pop’)
at new quill_better_table_BetterTable
I’ve been struggling with this issue for a week.
I tried other packages without any solution, yet I followed the documentation of vue-quill.
1