We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I have an array of strings in en.yml file like this:
strings: - String 1 - String 2 - String 3
And I'm trying to display the array in a component using v-for: <li v-for="string in t('strings')">{{ string }}</li>
v-for
<li v-for="string in t('strings')">{{ string }}</li>
But instead of displaying the array elements it iterates over the key and displays: s t r i n g s
v-for="$t('arrayOfString')" iterates over array of strings, not over the key
v-for="$t('arrayOfString')"
The issue is obvious and the provided information is enough to understand the problem?
"vue": "^3.1.5" "vue-i18n": "^9.1.7"
No response
The text was updated successfully, but these errors were encountered:
Hi, @aidar-kz
Function t can only return a string. In your case, you should use function tm and rt, like this:
t
tm
rt
<ul> <li v-for="string in tm('strings')">{{ rt(string) }}</li> </ul>
I have tested it and this can work.
See also these docs: t tm rt
Hope this helps.
Sorry, something went wrong.
Hi, @PeterAlfredLee
Thanks a lot for your help, it now works!
Best wishes!
No branches or pull requests
Reporting a bug?
I have an array of strings in en.yml file like this:
And I'm trying to display the array in a component using
v-for
:<li v-for="string in t('strings')">{{ string }}</li>
But instead of displaying the array elements it iterates over the key and displays:
s
t
r
i
n
g
s
Expected behavior
v-for="$t('arrayOfString')"
iterates over array of strings, not over the keyReproduction
The issue is obvious and the provided information is enough to understand the problem?
System Info
Screenshot
Additional context
No response
Validations
The text was updated successfully, but these errors were encountered: