Skip to content

Can't iterate over yaml array of strings  #614

@aidar-kz

Description

@aidar-kz

Reporting a bug?

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

Reproduction

The issue is obvious and the provided information is enough to understand the problem?

System Info

"vue": "^3.1.5"
"vue-i18n": "^9.1.7"

Screenshot

image

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

image

Additional context

No response

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions