Select Property
The select property renders a dropdown, letting users pick one option from a predefined list. It's great for choosing from categories, sizes, or any fixed set of values.
Fruit
Required Parameters
options
The options
property is an array that defines the choices for the dropdown.
Each option in the array should be an object with:
label
: The text users will see in the list.value
: The actual value that gets passed to your component.
Catalog.register('Sample', {
component: Sample,
props: {
fruit: {
label: 'Fruit',
type: 'select',
options: [
{ label: 'Apple', value: 'apple' },
{ label: 'Banana', value: 'banana' },
{ label: 'Orange', value: 'orange' },
],
},
},
});