2
I’m having trouble filtering the data to be displayed in a select html. How can I apply a filter that based on a variable (which will be populated by another select) returns all.name items that match for example year = 2005?
<select>
<option>Listar todos</option>
<option v-for="item in items">{{ item.name }}</option>
</select>
Vuejs:
new Vue({
el: '#app',
data: {
search: '',
items: [
{name: 'Stackoverflow', type: 'development', year: '2005'},
{name: 'Game of Thrones', type: 'serie', year: '2005'},
{name: 'Jon lim', type: 'actor', year: '2012'}
]
},
})
tried to use a
v-if
next to thev-for
?– Camilo Santos