未捕获的 ReferenceError:ExportWord 未定义 CkEditor5

问题描述

我正在尝试在我们的 MVC .NET Core 项目中实现 ckeditor5 的 ExportWord 功能。 下面是我为实现它而编写的代码。但我收到错误 未捕获的 ReferenceError:未定义 ExportWord。

<script src="https://cdn.ckeditor.com/ckeditor5/27.1.0/decoupled-document/ckeditor.js"></script>
<script>
import ExportWord from '@@ckeditor/ckeditor5-export-word/src/exportword';

DecoupledEditor
       .create(document.querySelector('#editor'),{
          cloudServices: {
               tokenUrl:'https://79399.cke-cs.com/token/dev/d650c302199a11c66a2282a459be96af7c917d9be8b2956c0af4b580446f',},plugins: [ExportWord],toolbar: {
             items: [
                     'exportWord','|','heading','alignment','bold','italic','strikethrough','underline','subscript','superscript','link','bulletedList','numberedList','todoList','fontfamily','fontsize','fontColor','fontBackgroundColor','code','codeBlock','insertTable','outdent','indent','uploadImage','blockQuote','undo','redo'
                   ],exportWord: {
                     stylesheets: ['EDITOR_STYLES'],fileName: 'file.docx',converterOptions: {
                          converterUrl: 'https://docx-converter.cke-cs.com/v1/convert',format: 'A4',margin_top: '20mm',margin_bottom: '20mm',margin_right: '12mm',margin_left: '12mm'
                          }
                    },shouldNotGroupWhenFull: true
             },})
         .then(editor => {
              const toolbarContainer = document.querySelector('#toolbar-container');

              toolbarContainer.appendChild(editor.ui.view.toolbar.element);
          })
         .catch(error => {
             console.error(error);
         });

我该如何实施?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)