我们已经扩展了graphql API的功能,为每个字段提供了list
属性选项。这意味着graphql响应将返回该字段的type
数组。这在我们的后端是支持的,但我们尚未为这些字段实现前端用户界面。这是相关的跟踪问题。目前有两个解决此问题的变通方法。
包装在object
字段中。如果你的字段看起来像这样
{type: "image",name: "images",label: "Images",list: true,}
可以改为使用
{type: "object",name: "images",label: "Images",list: true,fields: [{type: "image",name: "image",label: "A single image",}]}
现在你将能够在列表中添加和删除新图像。
你可以通过添加自定义字段来创建你自己的自定义用户界面。你需要制作一个符合模式中该类型的组件。完成后,你的字段可能看起来像这样。
{type: "image",name: "images",label: "Images",list: true,ui: {component: "MyCustomImageListingField",}}