-
-
Notifications
You must be signed in to change notification settings - Fork 64
Getting Started
Dang Van Thanh edited this page Aug 1, 2017
·
7 revisions
Include path of ckeditor in index.html
page
<script src="//cdn.ckeditor.com/4.6.2/full/ckeditor.js"></script>
or
<script src="/path/to/ckeditor.js"></script>
<template>
<div class="app">
<ckeditor
v-model="content"
:config="config"
@blur="onBlur($event)"
@focus="onFocus($event)">
</ckeditor>
</div>
</template>
<script>
import Ckeditor from 'vue-ckeditor2'
export default {
components: { Ckeditor },
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>
<template>
<div class="app">
<ckeditor
v-model="contentA"
types="inline"
:config="configA">
</ckeditor>
<ckeditor
v-model="contentB"
:config="configB"
@blur="onBlur($event)"
@focus="onFocus($event)">
</ckeditor>
</div>
</template>
<script>
import Ckeditor from 'vue-ckeditor2'
export default {
components: { Ckeditor },
data () {
return {
contentA: '',
configA: {
toolbar: [[ 'Bold' ]],
height: 300
},
contentB: '',
configB: {
toolbar: [[ 'Italic' ]],
height: 150
}
}
},
methods: {
onBlur (editor) {
console.log(editor)
},
onFocus (editor) {
console.log(editor)
}
}
}
</script>