surmon-china / vue-quill-editor

@quilljs editor component for @vuejs(2)
https://github.surmon.me/vue-quill-editor
MIT License
7.39k stars 1.03k forks source link

In nuxt project code highlighting create a Dead Cycle #317

Open TengFeiHao opened 5 years ago

TengFeiHao commented 5 years ago

In NUXT project, highlight.js asynchronous change 'content'. In 'onEditorChange(){}' , 'this.content' repeated assignment. So dead cycle. The code and error are as follows:

[Vue warn]: You may have an infinite update loop in a component render function.
found in
---> <QuillEditor> at components/common/quillEditor.vue
       <Pages/detail/Index.vue> at pages/detail/_index.vue
         <Nuxt>
           <Layouts/default.vue> at layouts/default.vue
             <Root> commons.app.js:13282:7
    NuxtJS 7
data() {
    return {
        content: ""
        editorOption: {
            modules: {
            toolbar: [ ... ],
            syntax: {
                highlight: text => hljs.highlightAuto(text).value
            }
        },
    }
},
methods: {
    onEditorChange({quill, html, text}) {
        this.content = html;
    },
}
lenvonsam commented 4 years ago

I have the same problem in ssr file at the componentUpdated function

image

Majid-Kamali commented 3 years ago

I have the same error to
You may have an infinite update loop in a component render function