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

494
Vistas
Vue.js How can I read the array values in [__ob__: Observer]

I need to create an array which will read 4 values ​​of type string and after that it will pass in a graph to create its columns.

This is my array bellow (poo: []) :

data() {
return {
  graphicData: {
    type: 'bar',
    data: {
      labels: [],
      datasets: [],
    },
    options: {
      responsive: true,
      lineTension: 1,
      scales: {
        yAxes: [
          {
            ticks: {
              beginAtZero: true,
              padding: 25,
            },
          },
        ],
      },
    },
  },
  average: 0,
  stepsGrade: [],
  poo: [], //This is my array

I pass the values ​​to it in this computed switch case

case 'P4':
      if (this.stepsGrade[0].step_grade > 92) {
        this.stepGradeIcon.push({ icon: 'mdi-emoticon-happy', color: 'green' });
        this.poo.push('green');;
      } else {
        this.stepGradeIcon.push({ icon: 'mdi-emoticon-sad', color: 'red' });
        this.poo.push('red');
      }

      if (this.stepsGrade[1].step_grade > 88) {
        this.stepGradeIcon.push({ icon: 'mdi-emoticon-happy', color: 'green' });
        this.poo.push('green');;
      } else {
        this.stepGradeIcon.push({ icon: 'mdi-emoticon-sad', color: 'red' });
        this.poo.push('red');
      }

      if (this.stepsGrade[2].step_grade > 84) {
        this.stepGradeIcon.push({ icon: 'mdi-emoticon-happy', color: 'green' });
        this.poo.push('green');;
      } else {
        this.stepGradeIcon.push({ icon: 'mdi-emoticon-sad', color: 'red' });
       this.poo.push('red');
      }

      if (this.stepsGrade[3].step_grade > 80) {
        this.stepGradeIcon.push({ icon: 'mdi-emoticon-happy', color: 'green' });
        this.poo.push('green');;
      } else {
        this.stepGradeIcon.push({ icon: 'mdi-emoticon-sad', color: 'red' });
        this.poo.push('red');
      }

      break;
  }

  return this.stepGradeIcon;

In my console log I have the data as follows

[__ob__: Observer]
0: "red"
1: "green"
2: "green"
3: "green"
length: 4
__ob__: Observer {value: Array(4), dep: Dep, vmCount: 0}
[[Prototype]]: Array

How can I read these 4 values ?

I try to use

var parsedobj = JSON.parse(JSON.stringify(this.poo));
    console.log(parsedobj);

Basically my array is only observated but never change and save the new value

about 4 years ago · Juan Pablo Isaza
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