To make use of the Html-Editor in your project just go to the Vue file and add the following code:
<editorHtml v-model="contentHtml"/>
If you need to add templates for the editor you must the following code:
<editorHtml v-model="contentHtml" :config="config" :templates="templates"/>
export default {
data() {
return {
templates: [
{
id: 1704,
name: "Name Template",
thumbail: "url preview",
createdAt: "0001-01-01T00:00:00"
},
],
config: {
// your fuction must return and object with the content of the 'html'
// the template parameter contains the information ode the template
async templateFormatter(template) {
return {
html: ''
}
}
},
}
},
}
If you need add custom field en el Ckeditor, you can make use of the replacementFields prop
<editorHtml v-model="contentHtml" :replacementFields="customFields"/>
export default {
data() {
return {
customFields: ["NewrepField1", "repField2"],
}
},
}
If you need to get the global config like:
-width
-backgroundColor
-contentColor
-viewOnline
-sendFooter
you have to make the call to a reference
<editorHtml v-model="contentHtml" ref="html-editor"/>
export default {
data() {},
methods: {
globalconfig() {
const globalconfig = this.$refs['html-editor'].globalconfig();
console.log('global setting', globalconfig )
},
}
}