Add option-label and option-value to QOptionGroup #16874
-
Hi there, I know that technically you can get around the issue of a multi-select option group with with a 'multiple' option added to a , but if you are trying to use your options param has to be tightly coupled to label value like so
If I wanted to use an interface for the options array, I will not be able to use it due to the conflict on the options param from Quasar. Take this example:
The :options section has the following error
Perhaps I am just missing something, and by all means if that is the case, please guide me, but if we were to allow map-options and emit-value to we could specify our label and value pair and we could keep our type safety |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 9 replies
-
You need to use the correct type, or don't enforce a type at all(e.g. let TS infer the type). import { QOptionGroupProps } from 'quasar';
const dietaryOptions: QOptionGroupProps['options'] = [
{ value: 1, label: 'Dairy Free' },
{ value: 2, label: 'Gluten Free' },
{ value: 3, label: 'Keto' },
{ value: 4, label: 'Nut Free' },
{ value: 5, label: 'Paleo' },
{ value: 6, label: 'Vegan' },
{ value: 7, label: 'Vegetarian' },
];
// or just
const dietaryOptions = [
// ...
]; |
Beta Was this translation helpful? Give feedback.
-
Just pushed: feat+perf(QOptionsGroup): new props -> option-value, option-label & option-disable #16874 |
Beta Was this translation helpful? Give feedback.
Just pushed: feat+perf(QOptionsGroup): new props -> option-value, option-label & option-disable #16874
Will be available in Quasar v2.17.0