0

我尝试在 ASP.NET Core 5 MVC 中添加 2 个插件(音频和 Mathtype),但这不起作用。

在使用插件构建后,我从( https://ckeditor.com/cke4/builder )安装了 ckeditor 4 。

提取文件夹和文件作为步骤。代码如下所示:

<h2>Ckeditor</h2>
<head>
    <meta charset="utf-8"> 
    <title>CKEditor</title>
    <script src="~/Content/ckeditor/ckeditor.js"></script>
</head>
<body>
    <textarea name="editor1"></textarea>
    <script>CKEDITOR.replace('editor1');</script>
</body>
4

1 回答 1

0

在您的 HTML 页面中添加一个 CKEditor 应该替换的元素:

<div id="editor">
    <p>This is some sample content.</p>
</div>

创建CKEditor 5的两个步骤:

  1. <script>通过标签加载所需的编辑器。

  2. 调用静态create()方法来创建编辑器。

例子

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>CKEditor 5 – Classic editor</title>
    <script src="https://cdn.ckeditor.com/ckeditor5/26.0.0/classic/ckeditor.js"></script>
</head>
<body>
    <h1>Classic editor</h1>
    <div id="editor">
        <p>This is some sample content.</p>
    </div>
    <script>
        ClassicEditor
            .create( document.querySelector( '#editor' ) )
            .catch( error => {
                console.error( error );
            } );
    </script>
</body>
</html>

结果

在此处输入图像描述

于 2021-03-15T02:41:53.797 回答