Answer the question
In order to leave comments, you need to log in
How to render this in a Vue template?
You need to get a table with the following columns:
Plan|Result|Deviation|Plan|Result|Deviation|Plan|Result|Deviation|Plan|Result|Deviation|
That is, the columns "plan", "result", "deviation" are repeated many times.
Single clear how to do:
<tr>
<td v-for="n in 30">План</td>
</tr>
Answer the question
In order to leave comments, you need to log in
data: () => ({
columns: [ 'aaa', 'bbb', 'ccc' ],
repeat: 5,
}),
computed: {
repeatedColumns() {
return Array(this.repeat).fill(this.columns).flat();
},
},
<td v-for="n in repeatedColumns">{{ n }}</td>
I think so to output a component in a cycle :) I myself am an initial junior
And how to make the necessary loop for my task in the Vue template?
<tr>
<td v-for="n in 30">
//30 раз цикл запускать зачем можно по другому (я junior <td v-for="n in 4"> )
</td>
</tr>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question