首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >CKEDITOR5未定义ReferenceError: SourceEditing未定义

CKEDITOR5未定义ReferenceError: SourceEditing未定义
EN

Stack Overflow用户
提问于 2022-01-21 11:12:20
回答 1查看 352关注 0票数 0

我在用CKEDITOR5。我的代码如下所示

当我用

代码语言:javascript
复制
plugins: [SourceEditing, Markdown],

我得到以下JS错误。

未定义ReferenceError: SourceEditing未定义

这是一个.NET。我下载并使用了CKEDITOR5文件(不是通过NPM安装的)

我需要导入什么Javascript才能使用SourceEditing?

在这方面,任何帮助都是非常感谢的。

代码语言:javascript
复制
<script src="~/lib/ckeditor5-build-classic/ckeditor.js"></script>


<script>

var myEditor;

ClassicEditor
    .create(document.querySelector('#txtaEditor'), {
        plugins: [SourceEditing, Markdown],
        toolbar: ['heading', '|',
            'fontfamily', 'fontsize', '|',
            'alignment', '|',
            'fontColor', 'fontBackgroundColor', '|',
            'bold', 'italic', 'strikethrough', 'underline', 'subscript', 'superscript', '|',
            'link', '|',
            'outdent', 'indent', '|',
            'bulletedList', 'numberedList', 'todoList', '|',
            'code', 'codeBlock', '|',
            'insertTable', '|',
            'uploadImage', 'blockQuote', '|',
            'undo', 'redo', 'editor'], shouldNotGroupWhenFull: true

    })
    .then(editor => {
        myEditor = editor;
    })
    .catch(error => {
        console.error(error);
    });
</script>
EN

回答 1

Stack Overflow用户

发布于 2022-01-24 08:36:27

下面的gif图像中的效果应该是您想要的。

经过调查,我发现安装插件通常使用nodejs或在线编译。因此,目前不应该使用cshtml文件中的plugins: [SourceEditing, Markdown],添加插件。

建议对非nodejs项目使用在线编译,然后下载并替换js和css文件路径。上述效果就是以这种方式实现的。我的项目结构的图片张贴在下面。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/70800349

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档