DEV Community

Discussion on: Vue: When a computed property can be the wrong tool

Collapse
lordsayur profile image
Omar

Hi, since you have a deep knowledge about computed property, could you write an article about using computed property with argument?

In my project, ive always encounter needing dynamic computed property especially when i want to use computed property in v-for loop where i need to get the index of the current item for the computed property. what i normally do is i created computed property that return a function that has one or more argument. ive read online this is not beneficial and the result are not being cached and the author suggest just to use normal function. so i would like to know is there any alternative to do this?