Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

126
Visualizações
Vue js render with different request

I am making an App with vue js and laravel using API,i am getting original data , but there is an optional parameter that i want to insert in the query to render the data accordingly, if there is no parameter detected , get the original query but if the parameter is there get the data that match the parameter. i do not know how to do it with filter() and i tried to do it with axios , but it is not working

methods : {
        fetchTransactions() {
        axios.get(linkApi + "transactions/proprietaire/" + this.getProprietaireId,
        {headers : {"Authorization" : "Bearer " + this.getToken}}
        ).then((res) => {
        this.transactions = res.data
        })
    },
  },

this one below is the function i created with the optional parameter

fetchTransactionsWithMois : function(event)
    {
        console.log(event)
        axios.get(linkApi + "transactions/proprietaire/" + this.getProprietaireId + "/" + $mois,
        {headers : {"Authorization" : "Bearer " + this.getToken}}
        ).then((res) => {
            this.transactions = res.data
            console.log("trans",this.transactions)
        })
    },

this is the filter function that i talked about earlier, this one can do what i want to do but i do not know how to filter date by month with this

    filteredTransactions() {
        return this.transactions.filter( transaction => 
        transaction.proprietaire.nom.includes(this.proprietaireSelected))       
    },
}

i do not know how can i populate the data in vue js accordingly, i aldready did my research, didn't find the answer

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda