question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't iterate over yaml array of strings

See original GitHub issue

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>

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

image

Screen Shot 2021-08-05 at 8 47 28 PM

image

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
antfucommented, Aug 6, 2021

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.

1reaction
aidar-kzcommented, Aug 6, 2021

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!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found