Answer the question
In order to leave comments, you need to log in
How to make a drop down menu like this in Vue?
Good morning everybody!
Compiled such a menu in the vue component
but it was required for item three ( three ) to add a submenu. I moved the nesting to childred , but I don't understand how to rebuild the template and implement a click on the third item. I need your help.
Answer the question
In order to leave comments, you need to log in
figured out
<ul>
<li v-for="item in navList">
<a :href="item.url" :class="item.cls" :title="item.name" @click="isOpen = !isOpen">{{ item.name }}
<ul v-if="item.children" :class="{ isOpen }" class="dropdown">
<li v-for="{ url, name, index } in item.children" :key="index">
<a :href="url" :title="name">{{ name }}
</li>
</ul>
</a>
</li>
</ul>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question