Answer the question
In order to leave comments, you need to log in
How to correctly display a list in html through Vue.JS?
I have a UL list
<ul class="aside-list" id="firstLevelCategories">
<li class="aside-list__item"><img src="images/face.png" alt="Face icon"><a class="aside-list__link" v-for="item in items" href="#">{{ item.message }}</a></li>
<li class="aside-list__item"><img src="images/hair.png" alt="Hair icon"><a class="aside-list__link" v-for="item in items" href="#">{{ item.message }}</a></li>
<li class="aside-list__item"><img src="images/body.png" alt="Body icon"><a class="aside-list__link" v-for="item in items" href="#">{{ item.message }}</a></li>
<li class="aside-list__item"><img src="images/mineral.png" alt="Mineral icon"><a class="aside-list__link" v-for="item in items" href="#">{{ item.message }}</a></li>
<li class="aside-list__item"><img src="images/child.png" alt="Child icon"><a class="aside-list__link" v-for="item in items" href="#">{{ item.message }}</a></li>
</ul>
let firstLevelCategories = {
0: "Уход за лицом",
1: "Уход за волосами",
2: "Уход за телом",
3: "Минеральная косметика",
4: "Уход за детьми"
}
for (let i = 0; i < Object.keys(firstLevelCategories).length; i++) {
let firstLevelMenu = new Vue({
el: '#firstLevelCategories',
data: {
items: [
{ message: firstLevelCategories[i] }
]
}
})
}
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