Vue2Editor
An easy-to-use but yet powerful and customizable rich text editor powered by Quill.js and Vue.js
View Docs
Install
You can use Yarn or NPM
npm install vue2-editor
OR
yarn add vue2-editor
Usage
// Basic Use - Covers most scenarios
import { VueEditor } from "vue2-editor";
// Advanced Use - Hook into Quill's API for Custom Functionality
import { VueEditor, Quill } from "vue2-editor";
Props
Name | Type | Default | Description |
---|---|---|---|
customModules | Array | - | Declare Quill modules to register |
disabled | Boolean | false | Set to true to disable editor |
editorOptions | Object | - | Offers object for merging into default config (add formats, custom Quill modules, ect) |
editorToolbar | Array | ** Too long for table. See toolbar example below | Use a custom toolbar |
id | String | quill-container | Set the id (necessary if multiple editors in the same view) |
placeholder | String | - | Placeholder text for the editor |
useCustomImageHandler | Boolean | false | Handle image uploading instead of using default conversion to Base64 |
v-model | String | - | Set v-model to the the content or data property you wish to bind it to |
Events
Name | Parameters | Description |
---|---|---|
blur | quill | Emitted on blur event |
focus | quill | Emitted on focus event |
image-added | file, Editor, cursorLocation | Emitted when useCustomImageHandler is true and photo is being added to the editor |
image-removed | file, Editor, cursorLocation | Emitted when useCustomImageHandler is true and photo has been deleted |
selection-change | range, oldRange, source | Emitted on Quill's selection-change event |
text-change | delta, oldDelta, source | Emitted on Quill's text-change event |
Examples
Example - Basic Setup
<template> <div id="app"> <vue-editor v-model="content">vue-editor> div> template> <script> import { VueEditor } from "vue2-editor"; export default { components: { VueEditor }, data() { return { content: "Some initial content
" }; } }; script>