|
I am having a helper function that return a list of options the labels are some keys that needs to be translated on rendered (using Vue I18n). I tried the but I get warning in the console: I guess it tries to translate again .... after the keys are found. In the fronted it shows the correct label... but the warnings .... So, I tried another solution, by removing the it works this workaround, but I don't like it very much. How to translate the labels using get-option-label? |
Replies: 1 comment
|
Hi @bci24,
It's better if you can "setup" your options passed to the
|
Hi @bci24,
:get-option-labelshould not be used for translations purposes.It's better if you can "setup" your options passed to the
VueSelectcomponent. For example, it's better to derivate using acomputed()that will usevue-i18nt()to translate the label before they hitVueSelect, like you've done in your previous example.:get-option-labelis similar to:get-option-valuein how it should be used, it's when you have to use a key that's different than the default.valueto do the mapping betweenlabel/value: https://vue3-select-component.vercel.app/props.html#getoptionlabel