1 year ago

#376162

test-img

Hasibul Hasan

How to use v-model in QuillJS in vue 3 app?

If I try to use v-model in the div with editor reference it gives me this error: "'v-model' directives aren't supported on elements."

<div ref="editor"></div>

<script>
import Quill from "quill";
export default {
  data() {
    return {
      description: "", // variable that I'm trying to use in v-model
      options: {
        modules: {
          toolbar: ["bold", "italic", { list: "ordered" }, { list: "bullet" }],
        },
        theme: "snow",
      },
    };
  },
  watch: {
    isDescription(newVal, oldVal) {
      if (newVal == true) {
        setTimeout(() => {
          new Quill(this.$refs.editor, this.options);
        }, 1);
      }
    },
  },
};
</script>

vue.js

vuejs3

quill

0 Answers

Your Answer

Accepted video resources