Powerful rich text editor using Vue.js and Quill. About @quilljs editor component for @vuejs

Overview

GitHub stars Build Status GitHub issues GitHub forks GitHub last commit license

NPM NPM

quill-vuejs

Quill editor component for Vue.

基于 Quill、适用于 Vue 的富文本编辑器,支持服务端渲染和单页应用。

Preview

Example

Install

NPM

npm install quill-vuejs --save

# or
yarn add quill-vuejs

CDN

 <div id="app">
        <quill-editor  
        ref="quillEditor"
        class="editor"
        v-model="content"
        :options="editorOption"
        @blur="onEditorBlur($event)"
        @focus="onEditorFocus($event)"
        @ready="onEditorReady($event)"
        />
    </div>
    <!-- Include the Quill library -->
    <script src="https://cdn.quilljs.com/1.3.4/quill.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/vue"></script>
    <!-- Quill JS Vue -->
    <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/quill-vuejs.js"></script>
    <!-- Include stylesheet -->
    <link href="https://cdn.quilljs.com/1.3.4/quill.core.css" rel="stylesheet">
    <link href="https://cdn.quilljs.com/1.3.4/quill.snow.css" rel="stylesheet">
    <link href="https://cdn.quilljs.com/1.3.4/quill.bubble.css" rel="stylesheet">
    <script type="text/javascript">
        Vue.use(window.VueQuillEditor);
        var app = new Vue({
            el: '#app',
            data: {
                content: '<h2>I\'m quill vuejs example</h2>',
                editorOption: {
                    theme: 'snow'
                }
            },
            methods: {
                onEditorBlur(quill) {
                    console.log('editor blur!', quill)
                },
                onEditorFocus(quill) {
                    console.log('editor focus!', quill)
                },
                onEditorReady(quill) {
                    console.log('editor ready!', quill)
                }
            },
            computed: {
                editor() {
                    return this.$refs.quillEditor.quill
                }
            },
            mounted() {
               console.log('this is quill instance object', this.editor)
            }
        });
    </script>

Mount

Mount with global

import Vue from 'vue'
import VueQuillEditor from 'quill-vuejs'

import 'quill/dist/quill.core.css' // import styles
import 'quill/dist/quill.snow.css' // for snow theme
import 'quill/dist/quill.bubble.css' // for bubble theme

Vue.use(VueQuillEditor, /* { default global options } */)

Mount with local component

import 'quill/dist/quill.core.css'
import 'quill/dist/quill.snow.css'
import 'quill/dist/quill.bubble.css'

import { quillEditor } from 'quill-vuejs'

export default {
  components: {
    quillEditor
  }
}

Register Quill module

import Quill from 'quill'
import yourQuillModule from '../yourModulePath/yourQuillModule.js'
Quill.register('modules/yourQuillModule', yourQuillModule)

// Vue app...

Component

<template>
  <!-- Two-way Data-Binding -->
  <quill-editor 
    ref="myQuillEditor"
    v-model="content"
    :options="editorOption"
    @blur="onEditorBlur($event)"
    @focus="onEditorFocus($event)"
    @ready="onEditorReady($event)"
  />

  <!-- Or manually control the data synchronization -->
  <quill-editor
    :content="content"
    :options="editorOption"
    @change="onEditorChange($event)"
  />
</template>

<script>
  // You can also register Quill modules in the component
  import Quill from 'quill'
  import someModule from '../yourModulePath/someQuillModule.js'
  Quill.register('modules/someModule', someModule)
  
  export default {
    data () {
      return {
        content: '<h2>I am Example</h2>',
        editorOption: {
          // Some Quill options...
        }
      }
    },
    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 change!', quill, html, text)
        this.content = html
      }
    },
    computed: {
      editor() {
        return this.$refs.myQuillEditor.quill
      }
    },
    mounted() {
      console.log('this is current quill instance object', this.editor)
    }
  }
</script>

Projects using quill-vuejs

Issues

Quill Modules

Quill

Quill API document

You might also like...

Twitter Text Libraries. This code is used at Twitter to tokenize and parse text to meet the expectations for what can be used on the platform.

twitter-text This repository is a collection of libraries and conformance tests to standardize parsing of Tweet text. It synchronizes development, tes

Jan 8, 2023

Obsidian plugin: Type text shortcuts that expand into javascript generated text.

Obsidian plugin: Type text shortcuts that expand into javascript generated text.

Obsidian Plugin - Text Expander JS (open beta) This Obsidian plugin allows the user to type text shortcuts that are replaced by (or "expanded into") j

Dec 27, 2022

A lightweight JavaScript library that renders text in a brilliant style by displaying strings of random characters before the actual text.

A lightweight JavaScript library that renders text in a brilliant style by displaying strings of random characters before the actual text.

cryptoWriter.js A lightweight javascript library which creates brilliant text animation by rendering strings of random characters before the actual te

Sep 13, 2022

🔖 lightweight, efficient Tags input component in Vanilla JS / React / Angular / Vue

🔖 lightweight, efficient Tags input component in Vanilla JS / React / Angular / Vue

Tagify - tags input component Transforms an input field or a textarea into a Tags component, in an easy, customizable way, with great performance and

Jan 2, 2023

🌐 Text Input Component for validating and formatting international phone numbers.

🌐  Text Input Component for validating and formatting international phone numbers.

React Native Intl Phone Field Try the Expo Snack 👏 🕹️ Demo It's a javascript-only (no native code) component that can run in iOS, Android, Expo & Re

Jul 8, 2022

A refined tool for exploring open-source projects on GitHub with a file tree, rich Markdown and image previews, multi-pane multi-tab layouts and first-class support for Ink syntax highlighting.

A refined tool for exploring open-source projects on GitHub with a file tree, rich Markdown and image previews, multi-pane multi-tab layouts and first-class support for Ink syntax highlighting.

Ink codebase browser, "Kin" 🔍 The Ink codebase browser is a tool to explore open-source code on GitHub, especially my side projects written in the In

Oct 30, 2022

Lexical is an extensible JavaScript web text-editor framework with an emphasis on reliability, accessibility and performance

Lexical is an extensible JavaScript web text-editor framework with an emphasis on reliability, accessibility and performance. Lexical aims to provide a best-in-class developer experience, so you can easily prototype and build features with confidence.

Dec 30, 2022

A fast, feature rich and simple framework for building dynamic browser applications.

A fast, feature rich and simple framework for building dynamic browser applications.

hyperdom A simple, fast, feature rich framework for building dynamic browser applications. Hyperdom supports a simple event-update-render cycle, promi

Nov 11, 2022

📗 A simple electron app to connect with Platzi and add a discord rich presence

📗 A simple electron app to connect with Platzi and add a discord rich presence

Platzi - Discord Rich Presence RPC Electron Requirements Nodejs you can download the latest version - here clone the repository like this - git clon

Oct 31, 2022
Comments
  • BUG

    BUG

    中文用户注意:

    1. 尽量用英文描述你的 Issue,你的问题是面向世界的
    2. 不要把内容堆彻在标题上,逻辑清晰地写在内容区
    3. 贴代码要提前格式化好,有颜色高亮那种,贴文本,不要贴图片
    4. 提问题前,务必仔细阅读 README.md;在已关闭的问题中寻找与自身相关的问题,90% 的可能它已经被解决

    BUG REPORT TEMPLATE

    Vue.js version and component version

    Reproduction Link

    • A minimal JSBin, JSFiddle, Codepen, or a GitHub repository that can reproduce the bug.
    • You could start with this template: https://jsfiddle.net/surmon/fpojgkmy/

    Steps to reproduce

    What is Expected?

    What is actually happening?

    opened by elonmusk-droid 0
Owner
Chi Zhang
To Shape, Not to Adapt @toeverything
Chi Zhang
Hemsida för personer i Sverige som kan och vill erbjuda boende till människor på flykt

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

null 4 May 3, 2022
Kurs-repo för kursen Webbserver och Databaser

Webbserver och databaser This repository is meant for CME students to access exercises and codealongs that happen throughout the course. I hope you wi

null 14 Jan 3, 2023
Browser extension to copy the page title and URL as rich text.

Copy Rich Link Browser extension to copy the page title and URL as rich text. Useful for pasting links to Slack, Google Docs, etc. Usage Install Insta

Ryo Nakamura 19 Dec 17, 2022
Instruction how to install laravel echo and pusher without vuejs or even npm

This 2 .js files are used to listen from server broadcasting with laravel-websockets, so that you don't need the use of Vue.js in your laravel app Fol

Muath Assawadi 7 Sep 28, 2022
VueJS based Shopsystem for the Athena Framework, absolute free and open source! Full Database Integration (MongoDB)

Open Source Shop Herewith we bring a free store system for the Athena Framework which is under the MIT license and thus can be completely modified and

Der Lord! 13 Oct 31, 2022
A table component for your Mantine data-rich applications, supporting asynchronous data loading, column sorting, custom cell data rendering, row context menus, dark theme, and more.

Mantine DataTable A "dark-theme aware" table component for your Mantine UI data-rich applications, featuring asynchronous data loading support, pagina

Ionut-Cristian Florescu 331 Jan 4, 2023
Tiny and powerful JavaScript full-text search engine for browser and Node

MiniSearch MiniSearch is a tiny but powerful in-memory fulltext search engine written in JavaScript. It is respectful of resources, and it can comfort

Luca Ongaro 2k Jan 3, 2023
Obsidian text generator Plugin Text generator using GPT-3 (OpenAI)

is a handy plugin for Obsidian that helps you generate text content using the powerful language model GP

null 356 Dec 29, 2022
Easiest 1-click way to install and use Stable Diffusion on your own computer. Provides a browser UI for generating images from text prompts and images. Just enter your text prompt, and see the generated image.

Stable Diffusion UI Easiest way to install and use Stable Diffusion on your own computer. No dependencies or technical knowledge required. 1-click ins

null 3.5k Dec 30, 2022
A powerful data visualization 2D/3D large-screen editor tool with low-code.

tp-editor(2D/3D)中文说明 A topology 2D/3D editor with nodejs, express, socket.io es6, HT for Web and vite. It's a powerful large-screen data visualization

Flying Li 11 Dec 25, 2022