-1
Good afternoon guys, I made a table that has its data iterated through v-for, it occurs that I need to filter this table by column I found the function filter however I can only filter one want to be able to filter the result of this filter using the criteria of the other columns.
I thought about putting && in the first table filter but it only shows result if fill all fields or || but it will show me qq thing I type in input
Follow the code I’m using to filter
follows code :
<script>
export default {
data() {
return {
CodigoPapel: "",
CodigoTipoNegociacao: "",
listas: [
{
CodigoPapel: 90,
NomeEmpresa: "IRBR1",
CodigoTipoNegociacao: 77,
},
{
CodigoPapel: 90,
NomeEmpresa: "ARGX4",
CodigoTipoNegociacao: 3,
},
{
CodigoPapel: 12,
NomeEmpresa: "Petrobras",
CodigoTipoNegociacao: 3,
},
],
};
},
computed: {
listaFiltrada: function () {
return this.listas.filter((item)=> {
return item.CodigoPapel == this.CodigoPapel
})
},
},
};
</script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.5.17/vue.js"></script>