【发布时间】:2020-06-17 21:35:40
【问题描述】:
KeystoneJS 提供了所见即所得字段类型的选项
此字段根据文本将字符串路径插入到您的架构中 字段类型实现,并在 Admin 中呈现 WYSIWYG 编辑器 使用 TinyMCE 的用户界面
如何编辑基于 TinyMCE 的所见即所得编辑器插件和外观?在 KeystoneJS 文档中的 this page 上,它说我们可以传入一个对象,我假设它被命名为 editorConfig
编辑器配置
默认值:{}
接受任何 TinyMCE 配置选项。这些将被传递给 tinymce.init 可用于覆盖 Keystone.js 的默认编辑器 外观和功能。
但它不适合我。
const editorConfig = {
selector: 'textarea',
menu: {
format: { title: "Format", items: "forecolor backcolor" }
},
toolbar: "forecolor backcolor"
};
text: { type: Wysiwyg, editorConfig},
当我尝试加载 CSS 时
const editorConfig = {
selector: 'textarea',
content_css: '/tinymce.css',
};
永远不会加载 CSS。
我尝试使用config 代替editorConfig,但这也不起作用。
【问题讨论】:
标签: tinymce keystonejs