Vue Quill Editor

3.0.6 · deprecated · verified Sun Apr 19

Vue Quill Editor (specifically `surmon-china/vue-quill-editor`) is a rich text editor component designed for Vue 2 applications, acting as a wrapper around the Quill.js editor. The package, currently at version 3.0.6, supports integration in both Single Page Applications (SPA) and Server-Side Rendering (SSR) environments. However, the library is officially deprecated by its maintainer due to the stalled maintenance of the upstream Quill.js project, and critically, it does not support Vue 3. While suitable for existing Vue 2 projects requiring a rich text editor, new development, especially with Vue 3, should consider alternative, actively maintained solutions like 'VueQuill' (a separate Vue 3 specific wrapper in beta) or 'Tiptap'.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to integrate `vue-quill-editor` into a Vue 2 application using local component registration. It shows how to bind content using `v-model`, customize editor options (including theme and a comprehensive toolbar), and handle key lifecycle and content change events. The editor's HTML output is displayed live below the component.

import Vue from 'vue';
import { quillEditor } from 'vue-quill-editor';

// Require Quill styles
import 'quill/dist/quill.core.css';
import 'quill/dist/quill.snow.css'; // Using the 'snow' theme

new Vue({
  el: '#app',
  components: {
    quillEditor
  },
  data() {
    return {
      content: '<h2>Hello Vue Quill!</h2><p>Start editing here.</p>',
      editorOption: {
        placeholder: 'Compose your rich text...', 
        theme: 'snow', // Available themes: 'snow', 'bubble'
        modules: {
          toolbar: [
            ['bold', 'italic', 'underline', 'strike'],
            ['blockquote', 'code-block'],
            [{ 'header': 1 }, { 'header': 2 }],
            [{ 'list': 'ordered'}, { 'list': 'bullet' }],
            [{ 'script': 'sub'}, { 'script': 'super' }],
            [{ 'indent': '-1'}, { 'indent': '+1' }],
            [{ 'direction': 'rtl' }],
            [{ 'size': ['small', false, 'large', 'huge'] }],
            [{ 'header': [1, 2, 3, 4, 5, 6, false] }],
            [{ 'color': [] }, { 'background': [] }],
            [{ 'font': [] }],
            [{ 'align': [] }],
            ['clean']
          ]
        }
      }
    };
  },
  methods: {
    onEditorBlur(quill) {
      console.log('Editor blur!', quill);
    },
    onEditorFocus(quill) {
      console.log('Editor focus!', quill);
    },
    onEditorReady(quill) {
      console.log('Editor ready!', quill);
    },
    onEditorChange({ quill, html, text }) {
      console.log('Editor content changed!', html, text);
      this.content = html;
    }
  },
  template: `
    <div id="app" style="font-family: Arial, sans-serif; max-width: 800px; margin: 20px auto;">
      <h1>Vue Quill Editor Example (Vue 2)</h1>
      <quill-editor
        v-model="content"
        :options="editorOption"
        @blur="onEditorBlur($event)"
        @focus="onEditorFocus($event)"
        @ready="onEditorReady($event)"
        @change="onEditorChange($event)"
      />
      <div style="margin-top: 30px; padding: 15px; border: 1px solid #eee; background: #f9f9f9;">
        <h3>Current Editor Content (HTML)</h3>
        <pre style="white-space: pre-wrap; word-break: break-all; background: #fff; padding: 10px; border: 1px solid #ddd;">{{ content }}</pre>
      </div>
    </div>
  `
});

view raw JSON →