Answer the question
In order to leave comments, you need to log in
What is the correct way to use the props of a locally imported vue-ckeditor5 component in Vue.js?
Good afternoon!
Using the vue-ckeditor5 component for ckeditor5 in Vue.js 2.
Declared the component locally in a separate cked.vue file
<template>
<div>
<vue-ckeditor type="classic" v-model="content"
:editors="editors1"
:toolbar-container="toolbar"
:config="conf">
</vue-ckeditor>
</div>
</template>
<script>
import ClassicEditor from '@ckeditor/ckeditor5-build-classic'
import VueCkeditor from 'vue-ckeditor5'
export default {
components: { 'vue-ckeditor': VueCkeditor.component },
data () {
return {
content: 'hello',
editors1: {
classic: ClassicEditor
},
toolbar: 'bold',
conf: { language: 'ru' }
}
}
}
</script>
Answer the question
In order to leave comments, you need to log in
toolbarContainer - CSS-selector of DOM-element for CKEditor toolbar. The element is searched by Document.querySelector()
<template>
<div>
<vue-ckeditor
v-model="content"
:editors="editors1"
:config="conf"
type="classic"
/>
</div>
</template>
<script>
import ClassicEditor from '@ckeditor/ckeditor5-build-classic'
import VueCkeditor from 'vue-ckeditor5'
export default {
components: { 'vue-ckeditor': VueCkeditor.component },
data () {
return {
content: 'hello',
editors1: {
classic: ClassicEditor
},
conf: {
language: 'ru',
toolbar: [ 'bold' ],
}
}
}
}
</script>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question