16_018_RHR
16_018_RHR

Reputation: 417

computed property shows the array but not the array elements separately

I have a computed property which is---

computed: {
      getGrouped() {
        let ColorwithRate = [];
        this.FilteredColor.forEach((c, index) => {
            c.selectedRate = 0;
            console.log(this.getGrouped[index])
            console.log(this.getGrouped[index].selectedColor)
         ColorwithRate.push(c);
        })

        return ColorwithRate;
      }
   },

the console.log(this.getGrouped[index]) shows an array in console.which is---

image But console.log(this.getGrouped[index].selectedColor , it shows --

Cannot read properties of undefined (reading 'selectedColor')

Upvotes: 1

Views: 319

Answers (1)

blackcityhenry
blackcityhenry

Reputation: 727

I believe you are using Vue3.

What does Proxy mean in the console in Vue 3?

Try console.log(toRaw(this.getGrouped.selectedColor)).

Upvotes: 1

Related Questions