Closed robodna closed 2 months ago
Pass your array in as the options
for Select
and then specify a custom format
function to pick the field (e.g. name
) you want to display.
If you are using createOptions
helper, you can specify key
instead for the basic case.
Note that solid-select
will pass through your full objects as the value. For example, onChange
will receive the full object for you to use.
Ok, that worked, thanks.
My options are an array of objects with "id" and "name" properties. How do I specify the key and value fields?
Thanks