koumoul-dev / vuetify-jsonschema-form

Create beautiful and low-effort forms that output valid data. Published on npm as @koumoul/vjsf.
https://koumoul-dev.github.io/vuetify-jsonschema-form/latest/
MIT License
539 stars 154 forks source link

Question: For Select, AutoComplete, Combobox, RadioGroup, ChipGroup how do I use state based items? #231

Open Mashiane opened 3 years ago

Mashiane commented 3 years ago

Hi there

For select, autocomplete, combobox, radiogroup etc, how can i use state bound items?

For example, for combo, autocomplete and select, we have an items property which can be an array of object with item-text, item-values.

I want to then save the state variable for items to be for example, "jobs", with item-value being "id" and item-text being "text".

My auto-complete, select, combobox, and perhaps the radio group should then be fed and items binding of :items="job" item-value="id" item-text="text"

How do I achieve this?

Can this behavior also be applied to the chip group for filtering purposes?

Thanks

JuliusJacobitz commented 2 years ago

Similar issue here: Is there any way to use item-value and item-text on enums resulting in v-selects? @albanm

albanm commented 2 years ago

I am not sure I fully understand the question. Isn't this solved by the x-fromData keyword shown in the Selects example ?

It can get data both from a context given as an option or from the current model, also see examples Selects with dependencies and Selects with context dependencies.

JuliusJacobitz commented 2 years ago

@albanm great that's it! Thank you for your fast response!