vueup / vue-quill

Rich Text Editor Component for Vue 3.
https://vueup.github.io/vue-quill/
MIT License
1.14k stars 283 forks source link

I got error Cannot convert undefined or null to object adding QuillBetterTable into QuillEditor #190

Closed sergeynilov closed 2 years ago

sergeynilov commented 2 years ago

In laravel 9 with Inertiajs/vuejs 3 I need to add table into vueup/vue-quill editor and looking at this article https://vueup.github.io/vue-quill/guide/modules.html#example

Adding QuillBetterTable support into my app:

<quill-editor
    :options="editorOptions"
    :modules="modules"
    theme="snow"
    :disabled="false"
    v-model:content="descriptionFormEditor.description"
    text-change="textChangeDescription"
    editorChange="editorChangeDescription"
    contentType="html"
    @blur="onEditorBlur($event)"
    @focus="onEditorFocus($event)"
    @ready="onEditorReady($event)"
    @textChange="onTextChange($event)"

>{{ descriptionFormEditor.description }}
</quill-editor>

    ...
    import { QuillEditor } from '@vueup/vue-quill'
    import '@vueup/vue-quill/dist/vue-quill.snow.css';
    import QuillBetterTable from 'quill-better-table' // https://github.com/soccerloway/quill-better-table
    ...

        let editorOptions = ref(
            [['better-table', 'bold', 'italic'], ['link', 'image']]
        )

        let modules = ref({
                table: false,  // disable table module
                'better-table': {
                    operationMenu: {
                        items: {
                            unmergeCells: {
                                text: 'Another unmerge cells name'
                            }
                        },
                        color: {
                            colors: ['#fff', 'red', 'rgb(0, 0, 0)'],  // colors in operationMenu
                            text: 'Background Colors'  // subtitle
                        }
                    }
                },
                keyboard: {
                    bindings: QuillBetterTable.keyboardBindings
                }
            }
        )
    ...

    ...
 return      
     editorOptions,
     modules,

    ...

But I got next error : https://prnt.sc/EIKGal7poJyT

    "@vueup/vue-quill": "^1.0.0-beta.8",
    "vue": "^3.2.30",
    "vue-loader": "^16.1.2"

Any hints what is it and how it can be fixed ?

Thanks!

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

arnosolo commented 2 years ago

I'm trying to add table support in @vueup/vue-quill. Do you know how to do this? Can you show me an example? Thank.

FreakYGG commented 1 year ago

@arnosolo , Hi there, did you by any chance get an example somewhere for table support within vue-quill?

I am struggling to get something working. Unless you went with another quill editor for vue3

ycldz commented 4 months ago

@vueup/vue-quill'e tablo desteği eklemeye çalışıyorum. Bunu nasıl yapacağımı biliyor musunuz? Bana bir örnek gösterebilir misiniz? Teşekkürler.

+1