Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

240
Vistas
how to sum or calculate value in array use vue

i have data array in this

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

how to calculate using sum ?

this my computed

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)
     });
 },

example in my table

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

if using operator * works and if using + doesn't work

thks

about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

This should work for you;

Since a callback function is required by Array.map() so the function body is supposed to be enclosed in braces '{}'

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 Denunciar

0

If you really want to add the 6 and 2

Surely all you need to do is what you have written in your comment line?
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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda