Can't iterate over yaml array of strings
See original GitHub issueI 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>
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 key
System Info
"vue": "^3.1.5"
"vue-i18n": "^9.1.7"
"vite": "^2.4.2"
Screenshot
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
need help iterating through array generated by yaml (php)
PHP does not use dot notation for arrays. It uses brackets. Try the following: foreach ($array as $path => $sub) { searchAndReplace($path ...
Read more >[Solved]-Iterate a yaml array with ruby-ruby - appsloveworld.com
There are two errors in your code: The object you get after loading the YAML file is not an array, it's a hash,...
Read more >Iterating over jQuery and non-jQuery Objects
It iterates over each matched element in the collection and performs ... Anytime we want to create an array or concatenated string based...
Read more >Iterative loops in Bicep - Azure Resource Manager
Use loops to iterate over collections in Bicep. ... a simple example of using an index, create a variable that contains an array...
Read more >How to iterate through array in config.yml file and get main ...
What I want to do is to iterate through every item in the config file "item_price", and find which "sub items" have "material:...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hey man, I got hundreds of issues coming everday, issue temple is the only thing we can have to potentially reduce the amount of them and keep critical issues more appearable to maintainers’ attention. As I said in the issue template, I don’t have time and energy to deal with the issues coming from users variations. Please don’t ignore it next time. Meanwhile, issue tracker is not the proper way to asking for help, there are GitHub discussions, Discord, Stackoverflow and forums for that.
Anyway, I am glad to hear you have find the solution for your issue.
Ah, I understand, of course, though it doesn’t exclude the case when someone else could help. Anyway, I already found a solution. And thank you for a good template!