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

238
Views
cómo sumar o calcular el valor en una matriz use vue

Tengo matriz de datos en este

 "item_tabel": [ { "method": { "select_method": 6, }, "innovation": { "select_innovation": 2, }, } ],

¿Cómo calcular usando la suma?

esto es mi computado

 subtotalRow() { return this.$store.state.item_tabel.map((item,i) => { return Number(item.method.select_method * item.innovation.select_innovation) //how to sum (item.method.select_method + item.innovation.select_innovation) }); },

ejemplo en mi tabla

 No | method | inov | total 1 | 6 | 2 | (6+2 = 8) //calculate 2 | 2 | 2 | 4 //calculate

si usar el operador * funciona y si usar + no funciona

gracias

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

Esto debería funcionar para usted;

Dado que Array.map() requiere una función de devolución de llamada, se supone que el cuerpo de la función debe estar encerrado entre llaves '{}'

 subtotalRow() { return this.$store.state.item_tabel.map( (item,i) => {item.method.select_method + item.innovation.select_innovation} ); },
about 4 years ago · Juan Pablo Isaza Report

0

Si realmente quieres sumar el 6 y el 2

Seguramente todo lo que necesita hacer es lo que ha escrito en su línea de comentarios.
 subtotalRow() { return this.$store.state.item_tabel.map( (item,i) => (item.method.select_method + item.innovation.select_innovation) ); },
about 4 years ago · Juan Pablo Isaza Report
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!