【问题标题】:How does one use the "Content" field type in KeystoneJS?如何使用 KeystoneJS 中的“内容”字段类型?
【发布时间】:2020-06-05 17:12:51
【问题描述】:

如何在 KeystoneJS 中使用Content field type?按照上面链接中给出的示例,我在 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”等的信息......

这一切都被所见即所得的编辑器取代了吗?还是他们做不同的事情?

【问题讨论】:

    标签: keystonejs


    【解决方案1】:

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

    这是打开所有选项后的样子:

    这是我删除额外格式选项(裸内容字段)时的样子

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-07-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-10-19
      • 2013-06-09
      • 2017-05-17
      相关资源
      最近更新 更多