vue-quill icon indicating copy to clipboard operation
vue-quill copied to clipboard

Cannot convert undefined or null to object

Open shangchen0531 opened this issue 2 years ago • 1 comments

Version @vueup/vue-quill version from 1.0.0-beta.2 to 1.0.0-beta.8

Describe the bug Can't resolve the prop modules and toolbar, throw error like that:

Uncaught TypeError: can't convert undefined to object

To Reproduce Steps to reproduce the behavior:

  1. Create a file named VueQuill.vue which has the contents:
<template>
    <QuillEditor 
    theme="snow" 
    v-model:content="content" 
    :modules="module"
    :toolbar="full"
     />
</template>

<script>
import { QuillEditor } from '@vueup/vue-quill'
import BlotFormatter from 'quill-blot-formatter';
import '@vueup/vue-quill/dist/vue-quill.snow.css';

export default {
    name: "VueQuill",
    data() {
        return {
            module: {
                name: 'blotFormatter',
                module: BlotFormatter,
                options: {}
            }
        }
    },
    props: {
        content: ''
    },
    mounted() {
        console.log(this.module)
    },
    components: {
        QuillEditor
    }
}
</script>
  1. And the contents of App.vue are:
<script setup>
import VueQuill from "./components/VueQuill.vue"
import { ref } from 'vue';

const data = ref(`
      <p><iframe class="ql-video" frameborder="0" allowfullscreen="true" src="https://www.youtube.com/embed/rg6CiPI6h2g" height="196" width="391"></iframe></p>
      <img src="https://fakeimg.pl/300/">Scientist Tu Youyou, a 2015 Nobel Prize laureate, does research in her lab in Beijing. [Photo/Xinhua]
      <p>President Xi Jinping said on Monday that China stands ready to make greater contributions to the health of humanity by enhancing public health exchanges and cooperation with the international community.</p> `)
</script>

<template>
  <VueQuill v-model:content="data" contentType="html"/>
</template>
  1. Run the project and open the browser, then open the Dev tool
  2. See error

Expected behavior There are no errors shown in the console and the html data can render correctly.

Reproduction link If available, add a link to the source code to help explain your problem.

https://codesandbox.io/s/zen-ully-9jnvmh?file=/src/components/VueQuill.vue

Browser (please complete the following information):

  • Mozilla Firefox for Ubuntu
  • 99.0

Additional context Operating System: Ubuntu 20.04.3 LTS

shangchen0531 avatar Jun 09 '22 03:06 shangchen0531

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.

stale[bot] avatar Aug 08 '22 04:08 stale[bot]