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

148
Views
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
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!