COMPUTED PROPERTIES¶
Example¶
Comparison with methods¶
Here we can see it updates really fast super fast.
Like searching any title really fast.
And can also check the highest and the lowest rating of titles
#So using our computer property in place of data, we have a different view of this data. We have methods like we had before running off of that view instance and then in the computed values we have just another object.
Here I am blurring out the method part , so just to focus on computed property. we have filteredfilms() and inside it we have RegExp to get rid of capitalisation thing - lower and uppercase.
So, the only change we made in computed property code is: instead of v-for=”entry in ratingsInfo” we change it to v-for=”entry in filteredfilms”. Instead of using ratings info like we had in this, in our data property we are just changing it to filtered.