0
votes

I am new to Vuejs & trying to use vue-quill-editor. Here I am trying to Use Quill editor Component in other components.

WysiwygInput.vue

 <quill-editor
  :options="{
    placeholder: placeholder,
  }"
  :content="content"
  v-on:change="$emit('change', $event.target.content)"
></quill-editor>

App.vue

<wysiwyg-input v-model="content" placeholder="Post Content" />

This is showing the following error in the console.

[Vue warn]: Error in v-on handler: "TypeError: Cannot read property 'content' of undefined"

I know this is something basic but can't solve this.

CodeSandbox link

1

1 Answers

2
votes

You should add an arrow function as handler with $event as parameter and emit the text property as $emit payload :

  v-on:change="($event)=>$emit('change', $event.text)"