[Vuejs]-Computed property getting called before prop initialization

0👍

I would debug what .filter() is doing with a console log inside of it, for example:

this.all.filter(ele => { 
    console.log(`${ele.type} === ${this.type.toLowerCase()}?`, ele.type === this.type.toLowerCase());
    return ele.type === this.type.toLowerCase(); 
})`

which will print out the result of ele.type === this.type.toLowerCase() every loop so you can verify what exactly is happening.

Leave a comment