Skip to main content

Rich Text Editor Component Documentation

1. Introduction

These swappable Vue components, TiptapEditor and QuillEditor, provide a rich text editing experience with a consistent API. This allows developers to easily switch between a highly customizable, lightweight editor (Tiptap) and a feature-rich, easy-to-use editor (Quill) without refactoring the parent component. The components are designed to be controlled via v-model for HTML content and an optional .sync modifier for the editor’s native data format (JSON for Tiptap, Delta for Quill).

2. Installation & Prerequisites

Before using the components, ensure you have installed the necessary dependencies in your Vue 2 project.
Crucial Step for Quill: You must import Quill’s CSS files globally in your application’s entry point, typically main.js.

3. API Reference (Props & Events)

Both TiptapEditor and QuillEditor share the exact same API for seamless integration.

Props

Events


4. Usage Examples

Here is a comprehensive example of a parent component that utilizes all features of the editor wrappers.

Parent Component Setup (MyDocument.vue)



Dokumentasi Komponen Rich Text Editor

1. Pendahuluan

Komponen Vue TiptapEditor dan QuillEditor ini menyediakan fungsionalitas rich text editing dengan API yang konsisten. Hal ini memungkinkan developer untuk dengan mudah beralih antara editor yang sangat ringan dan dapat dikustomisasi (Tiptap) dengan editor yang kaya fitur dan mudah digunakan (Quill) tanpa perlu mengubah kode pada komponen induk. Komponen ini dirancang untuk dikontrol melalui v-model untuk konten HTML dan modifier .sync opsional untuk format data asli editor (JSON untuk Tiptap, Delta untuk Quill).

2. Instalasi & Prasyarat

Sebelum menggunakan komponen, pastikan Anda telah menginstal dependensi yang diperlukan di proyek Vue 2 Anda.
Langkah Penting untuk Quill: Anda harus mengimpor file CSS Quill secara global di titik masuk aplikasi Anda, biasanya di main.js.

3. Referensi API (Props & Events)

Baik TiptapEditor maupun QuillEditor memiliki API yang sama persis untuk integrasi yang mulus.

Props

Events


4. Contoh Penggunaan

Berikut adalah contoh komprehensif dari komponen induk yang memanfaatkan semua fitur dari wrapper editor.

Pengaturan Komponen Induk (MyDocument.vue)