Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not possible to get and set selected value of ChoiceGroup #15

Open
WillemJann opened this issue Jul 27, 2021 · 0 comments
Open

Not possible to get and set selected value of ChoiceGroup #15

WillemJann opened this issue Jul 27, 2021 · 0 comments
Assignees

Comments

@WillemJann
Copy link

For the ChoiceGroup component there is no model defined. It is therefore not possible to set the intial selected value, retrieve the selected value and update the selected value.

Suggested syntax:

<ChoiceGroup v-model="selectedOption" :options="options" />

Alternative (similar to CheckBox):

<ChoiceGroup v-for="item in items"
          :key="item.index"
          :selected="selection.indexOf(item.index) > -1"
          @input="onSelect(item)">
      {{ item.text }}
</ChoiceGroup>

An advantage of the syntax with slots is that in the for loop extra content (e.g. an icon) can be added per individual choice group item.

@johannes-z johannes-z self-assigned this Jul 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants