B
B
bqio2019-01-17 07:47:45
Vue.js
bqio, 2019-01-17 07:47:45

How to output values ​​through 2 v-for in Vue?

There are the following inputs:

"platforms": [
{
  "id": 0,
  "name": "3DS",
  "files": ["1.1 [EUR] Японский шрифт", "1.1 [EUR]", "1.1 [JAP]"]
}
]

<div class="row" v-for="platform in project.platforms" :key="platform.id">
      <template v-for="file in platform.files">
        <div class="four columns">{{file}}</div>
        <div class="four columns">{{platform.name}}</div>
        <div class="four columns">Download</div>
      </template>
    </div>

Writes that :key is required for this, but you can't use it in template.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vladimir Malkov, 2019-01-17
@MalkovVladimir73

The documentation does not use the key for template. Everything will work anyway.
5c4015490b58b713592703.png

P
Philip Gaponenko, 2019-01-17
@filgaponenko

What's stopping you from using div instead of template?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question