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

153
Visualizações
Vuejs loop component and get the emitted data in instant

I loop a child components that has emitted data and pass to local data in parent but my expectation result is not what i get. It should be in incremental like this. Example

Index       Total
0             5
1             7
2             10
3             12

here my code:

<template>
  <div>
    <div v-for="data, index in myArr">
      <child-block-1
        :key="index"
        :data="data"
        @emittedData="total += $event"
      />
      <child-block-2 v-if="total > 10" />
    </div>
  </div>
</template>

The total data will add the emitted data, but when i check the total it will always the overall total 12. not the incremental.

Is there any other solution for this to get what my expected result ?

about 4 years ago · Santiago Gelvez
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