VueCkeditor5
Description
Component CKEditor 5 for Vue 2.
Project is outdated. See official release.
Installation
NMP
npm install vue-ckeditor5
Manual
Download file from repository, paste it in your project and insert path to it in your page by code:
Usage
How to
You must paste CKEditor's 5 implementations to vue component. You can use even custom build of CKEditor 5.
See examples.
First way - Global
You can register component globaly by plugin (recommended):
const options = editors: classic: ClassicEditor name: 'ckeditor' Vue;
Then you can use the component in your template:
Plugin options
property | type | required | default | description |
---|---|---|---|---|
editors | Object | true |
Map of editors:
|
|
name | String | false | 'vue-ckeditor' |
Name of component. |
Second way - Local
You can register component localy:
el: '#app' components: 'vue-ckeditor': VueCkeditorcomponent data: value1: 'hello' value2: 'world' editors: classic: ClassicEditor template: `<vue-ckeditor type="classic" v-model="value1" :editors="editors"></vue-ckeditor>`
Component's props
prop | type | required | default | description |
---|---|---|---|---|
config | Object | false | {language:'en'} |
Object with config properties for CKEditor 5 instance. |
editors | Object | false | {} |
Map of editors:
|
emptyValue | false | Set if you want to change the 'v-model' value of emptiness editor. | ||
readonly | Boolean | false | false |
Read-only mode for CKEditor 5 instance. |
tag | String | false | div |
HTMLElement for rendering. |
toolbarContainer | String | false | null | CSS-selector of DOM-element for CKEditor toolbar. The element is searched by Document.querySelector(). |
type | String | true | Key for CKEditor 5 implementation of 'editors' prop. | |
value | String | true | '' |
Value for data bindings. Use 'v-model' for it. |
Normal HTML attributes
You can bind normal HTML attributes to component like this (data-api
for example):
Component's events
name | parameters | description |
---|---|---|
ready(instance) |
|
Instance of CKEditor is ready. |
destroy(instance) |
|
Instance of CKEditor is destroyed. |
input(newValue, instance, eventInfo, batch) |
|
Data is changed. |
Events from engine.view.document (check example5).