Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using CKEditor 5 with nuxtjs

I'm trying to import a custom build of CKEditor 5 in my Nuxtjs project and I've been tried every possible way to import it correctly but none of them worked for me and this is one of them:

let ClassicEditor
    let CKEditor

    if (process.client) {
      ClassicEditor = require('./../../static/js/ckeditor')
      CKEditor = require('@ckeditor/ckeditor5-vue')
    }else{
      CKEditor = { component : {template:'<div></div>'}}
    }
  data() {
    return {
         editor: ClassicEditor,
   }
}
  components:{
ckeditor: CKEditor.component
  },
<client-only><ckeditor :editor="editor" /></client-only> 

Every time I change the way a different error appears, for example, Window is not Defined and when i use different way shows a different error so I want to know what is the most correct way to use CKEditor with Nuxtjs in universal mode, consider that i haven't done anything and help me with the correct way starting from the installation

like image 589
Eslam Magdy Avatar asked Jun 19 '26 22:06

Eslam Magdy


1 Answers

try this

npm install --save @blowstack/ckeditor-nuxt

like image 192
zero8 Avatar answered Jun 23 '26 01:06

zero8