繁体   English   中英

如何使用 KeystoneJS 中的“内容”字段类型?

[英]How does one use the "Content" field type in KeystoneJS?

如何使用 KeystoneJS 中的Content 字段类型 按照上面链接中给出的示例,我已将以下内容放入我的 index.js 中:

keystone.createList('Todo', {
    schemaDoc: 'A list of things which need to be done',
    fields: {
        name: {type: Text, schemaDoc: 'This is the thing you need to do'},
        blip: {type: Text, schemaDoc: 'This is another thing'},
        status: {type: Select, options: 'pending, processed'},
        rating: { type: Stars, starCount: 5 },         body: {
            type: Content,
            blocks: [
                Content.blocks.blockquote,
                Content.blocks.image,
                Content.blocks.link,
                Content.blocks.orderedList,
                Content.blocks.unorderedList,
                Content.blocks.heading,
                // CloudinaryImage.blocks.image,
            ],
        },
    },

但是当我转到前端并单击那里的“+”按钮时,它只为我提供了插入图像的选项(见下面的截图)

我应该看到什么? 如果我应该看到更多,我应该做什么? 我没有看到有关“blockquote”、“link”、“orderedList”等的任何信息......

这一切都被 Wysiwyg 编辑器取代了吗? 或者他们做不同的事情? 在此处输入图片说明

您必须编写一些文本,然后选择该文本作为文本格式项。

这是所有选项的外观:

在此处输入图片说明

这是我删除额外格式选项(裸内容字段)时的样子在此处输入图片说明

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM