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

490
Visualizações
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 à 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