I need to hide an element from v-for with v-show.
I have a list that populates a menu and I need to hide a certain element, can someone give me a light?
I need to hide an element from v-for with v-show.
I have a list that populates a menu and I need to hide a certain element, can someone give me a light?
Hello, I think it's just you add a boolean with the condition to display the element inside each object link.
<router-link v-for="(link,index) in sidebarLinks" v-show="link.CODICAO_PARA_EXIBIR_ELEMENTO" :to="link.path" tag="li" :ref="link.name" :key="link.name + index">
<a>
<i :class="link.icon"></i>
<p>{{link.name}}</p>
</a>
</router-link>
Hi, unlike the Angular, for example, Vue accepts two directives in the same element:
<button v-for="(letra, indice) in letras"
@click="inserirLetra(letra, indice)"
v-show="botoesRemovidos.indexOf(indice) < 0">
{{ letra }}
</button>
So it's super simple.
This example I'm showing you, myself that I used in the anagramador project that is part of the book Vue: a practical approach .
I hope I have helped!