Answer the question
In order to leave comments, you need to log in
How to trigger a v-for loop on a div with html inside?
Good evening, please tell me how to create a vue loop for such markup.
<div class="container">
<div class="row" v-for="block in blocks">{{block}}</div>
</div>
data: {
blocks: [
block: '<div class="block-5"> <ul v-for="item in list"> {{item}} </ul> </div>',
block: '<div class="block-7"> <ul v-for="item in list2"> {{item}} </ul> </div>',
],
list: [
item: '<h1> Заголовок 1 </h1> <p> какой-то текст 1 </p>',
item: '<h1> Заголовок 2 </h1> <p> какой-то текст 2 </p>',
item: '<h1> Заголовок 3 </h1> <p> какой-то текст 3 </p>'
],
list2: [
item: '<h1> Заголовок 3 </h1> <p> какой-то текст 4 </p>',
item: '<h1> Заголовок 4 </h1> <p> какой-то текст 5 </p>',
item: '<h1> Заголовок 5 </h1> <p> какой-то текст 6 </p>'
],
}
<div class="app">
<div class="element"> some text </div>
</div>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question