easyblocks
easyblocks copied to clipboard
Feature: default for component collections
Motivation: In some cases you want to repeat the same item in a component collection over and over. It seems redundant to ask the user each time which component they want - especially when there is only one item in the component collection to choose from
{
type: "select"
prop: "type",
params: {
options: [{value: "icon-and-text", label: "Icon And Text"}, {value: "text-only", label: "Text"}]
}
},
{
type: "component-collection",
prop: "data",
label: "List Items",
accepts: (value) => value.type, // optionally can be dynamically set
autoPopulate: true // when there is only one value in accepts it will autopopulate
}