quasar icon indicating copy to clipboard operation
quasar copied to clipboard

[Request] Simplify options for QSelect

Open kerbo opened this issue 8 years ago • 6 comments

There should be a way to provide the options for a QSelect using a simple array, e.g.,

['Yes', 'No']

The array values provide both the label and value.

kerbo avatar Jun 12 '18 22:06 kerbo

And it's so simple to pass ['Yes', 'No'].map(value => ({value, label: value}))

pdanpdan avatar Jun 13 '18 05:06 pdanpdan

What about i18n?

Scott

smolinari avatar Jun 13 '18 14:06 smolinari

@smolinari What has i18n to do with the values he should pass to options?

pdanpdan avatar Jun 13 '18 15:06 pdanpdan

Please follow pdandan's recommendation. Adding this to QSelect will slightly decrease performance as additional checks need to be made. We want to avoid that. Thank you.

rstoenescu avatar Jun 14 '18 09:06 rstoenescu

@pdanpdan - I meant l10n. It is text that is shown to the user as a selection. This would need to be translated for multi-lingual applications. Maybe that isn't a concern?

Scott

smolinari avatar Jun 14 '18 15:06 smolinari

@smolinari It's programmers job to provide translated labels for the values.

pdanpdan avatar Jun 14 '18 18:06 pdanpdan