簡體   English   中英

如何在 CKEditor 5 on Vuejs 上激活或安裝插件

[英]How to activate and or install plugins on CKEditor 5 on Vuejs

我需要在 Vue 上激活 CKEditor 上的 PastFromOffice 插件。 這就是我設法工作的方式。 我已經安裝了“npm install --save @ckeditor/ckeditor5-paste-from-office”我知道這個插件以前安裝在經典的 CKEditor 上。

<template>
   <ckeditor :editor="editor" v-model="editorData" :config="editorConfig"></ckeditor>
</template>

<script>
   import ClassicEditor from '@ckeditor/ckeditor5-build-classic'
   import VueCkeditor from '@ckeditor/ckeditor5-vue'

   console.log(ClassicEditor.defaultConfig.toolbar);
   export default {
       components: {
           ckeditor: VueCkeditor.component
       },
       data(){
           return {
               editor: ClassicEditor,
               editorData: '<p>Content of the editor.</p>',
               editorConfig: {
                   /*plugins: [
                       'PasteFromOffice'
                   ],*/
               }
           }
       }
   }
</script>

當我像評論中那樣應用插件時,我得到一個空的輸入類型文本框和許多 console.logs 聲稱“請求的工具欄項目不可用。”

如果我添加:“從‘@ckeditor/ckeditor5-paste-from-office/src/pastefromoffice’導入 PasteFromOffice;” 我收到此錯誤:“ckeditor-duplicated-modules:一些 CKEditor 5 個模塊重復。”

有什么關鍵字可以讓我谷歌或想法嗎? 謝謝!

<template>
  <div class="editor">
    <ckeditor :editor="editor" v-model="editorData" :config="editorConfig" />
  </div>
</template>

<script>
import ClassicEditor from '@ckeditor/ckeditor5-build-classic';

export default {
  name: "Editor",
  data() {
    return {
      editor: ClassicEditor,
      editorData: "<p>Content of the editor.</p>",
      }
    }
};
</script>
require('./bootstrap');
import Vue from 'vue'
import Editor from './editor'
import CKEditor from "@ckeditor/ckeditor5-vue";

Vue.use(CKEditor);

new Vue({
    el : '#root',
    components: { Editor },
})
    <div id="root">
        <editor></editor>
    </div>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM