1
I have the following array, which is a menu, I entered a search field at the beginning and would like that filtered case to show only items that contain certain text.
<script>
this.vue = new Vue({
el:"#menu_principal",
data : {
busca_menu : '',
menu : [ { "categoria": "Agenda", "itens": [ { "nome": "Agenda"}, { "nome": "Novo Compromisso"} ]],
},
computed: {
filteredMenu: function() {
if(this.busca_menu == ''){
return this.menu;
} else {
return this.menu.itens.nome.includes(this.busca_menu);
}
}
},
mounted(){
}
})
</script>
It was not very clear your question, and if possible put Html tbm!
– LeAndrade
Has there been any response?
– novic