Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

127
Views
Passing a axios request to a child component in vue.js

I am breaking my head in this. I am new to a fullstack project involving fullstack with vue.js and node.js. My problem is: My get request is functioning and fetching data from database, but, I can't pass these data's via props on a component. It keeps telling that "paciente" is not defined. Here's the code:

<div><div v-for="(paciente, index) in pacientes" :key="index">
        <div class="blocoDeInformacao">
          <h2 class="nomePessoa">{{paciente.nome}}</h2>
          <h4 class="cpfPessoa">{{paciente.cpf}}</h4>
          <div class="bordinha"></div>

          <span class="botoes">
            <button class="botao " @click="s1 = 1, bExcluir = false"><img class="icone" src="@/assets/paper.png" alt="editarPaciente"></button>
            <button class="botao" @click="bExcluir = true, bCerto = paciente.id"><img class="icone" src="@/assets/trash.png" alt="excluirPaciente"></button>
          </span>
          <div class="excluir" v-show="bExcluir == true && bCerto == informacaoPessoa.id">
            <img class="alertIcon" src="@/assets/alert.png" alt="iconeAlerta">
            <h2 class="confirmacaoExclusao">Quer realmente excluir esse paciente?</h2>
            <div>
              <button class="botaoEscolha" @click="confirmacaoExcluir(paciente.idpaciente)">Sim</button>
              <button class="botaoEscolha" @click="bExcluir = false">Não</button>
            </div>
          </div>
        </div>
      

      </div></div>
    </div>
  </div>
</div>
<div v-else-if="s1 == 1">
  <editarPaciente :nomePessoa="paciente.nome"
       :cpfPessoa="paciente.cpf" :senhaPessoa="paciente.senha" :id="paciente.idpaciente" :key="paciente.idpaciente"/>
</div>

and the props from components:

 export default {
  name: 'editarPaciente',
  components: {
  },

  props: {

    nomePessoa: String,
    cpfPessoa: String,
    senhaPessoa: String,
    id: String
  },
  
  
}
</script>
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!