首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >ckeditor 5在线构建器未显示

ckeditor 5在线构建器未显示
EN

Stack Overflow用户
提问于 2020-05-28 19:30:29
回答 3查看 1.4K关注 0票数 3

我使用了ckeditor 5在线构建器,下载了一个压缩文件。我将其解压缩并创建了一个html文件来包含编辑器,如下所示:

代码语言:javascript
运行
复制
<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>College Connect</title>

    <script src="ckeditor5/build/ckeditor.js"></script>
    
</head>

<body>
    <div id="editor"></div>
    
    <script>
        ClassicEditor
            .create(document.querySelector('#editor'))
            .then(editor => {
                console.log(editor);
            })
            .catch(error => {
                console.error(error);
            });
    </script>
</body>

</html>

但是,当我使用来自here的完整版时,它工作得很好。

在使用在线构建器之前有什么需要做的吗?

EN

Stack Overflow用户

发布于 2020-07-11 17:38:21

以这种方式设置工具栏对我来说很有效。

代码语言:javascript
运行
复制
let editor;

ClassicEditor.create(document.querySelector('#id-textarea'), {
  toolbar: [
    'heading',
    'bold',
    'italic',
    'underline',
    'fontFamily',
    'fontSize',
    'fontColor',
    'undo',
    'redo',
    'alignment',
    'indent',
    'list',
    'horizontalLine',
    'paragraph',
    'removeFormat',
    'specialCharacters',
    'wordCount',
  ],
})
  .then((newEditor) => {
    editor = newEditor;
  })
  .catch((error) => {
    console.error(error);
  });
票数 0
EN
查看全部 3 条回答
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/62063616

复制
相关文章

相似问题

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