pwilkniss / vue-ckeditor2

Ckeditor using for Vue.js 2

Home Page:https://vue-ckeditor2.surge.sh/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

vue-ckeditor

Ckeditor using for Vue.js 2

Requirements

Install

CDN

<script src="https://unpkg.com/vue-ckeditor2"></script>

NPM

$ npm install vue-ckeditor2 --save

Usage

This document applies to v2.0+. If you are looking for older versions, docs are here

Component

Then in your component:

<template>
  <div>
    <vue-ckeditor v-model="content" :config="config" @blur="onBlur($event)" @focus="onFocus($event)" />
  </div>
</template>

<script>
import VueCkeditor from 'vue-ckeditor2';

export default {
  components: { VueCkeditor },
  data() {
    return {
      content: '',
      config: {
        toolbar: [
          ['Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript']
        ],
        height: 300
      }
    };
  },
  methods: {
    onBlur(editor) {
      console.log(editor);
    },
    onFocus(editor) {
      console.log(editor);
    }
  }
};
</script>

Props

Name Type Description
name String Name of instance ckedior. **Default: editor- **
id String Id of instance ckedior. Default: editor-1
types String Types of ckedior. Default: classic
config Object All configuration of ckeditor. Default: {}
instanceReadyCallback Function Optional function that will be attached to CKEditor instanceReady event.
readOnlyMode Boolean Option setReadOnly editor initializes in the proper mode. Default: false

Build Setup

You can use vue-cli with vue-rollup-boilerplate templates or other vue templates

Created By

Thanks to:

License

MIT © Dang Van Thanh

About

Ckeditor using for Vue.js 2

https://vue-ckeditor2.surge.sh/


Languages

Language:Vue 97.7%Language:JavaScript 2.3%