In Vue.js, computed properties are properties that are derived from other reactive properties.

If we just return an expression in the computed property, then we can access it like any other reactive property.

However, we can’t call it like a method to pass in values to computed properties this way.

In this article, we’ll look at how we can pass arguments into computed properties.

Return a Function

We can return a function in our computed property if we want to create a computed property that accepts arguments.

For instance, we can write:


How to Pass Arguments in Computed Properties in Vue.js
2.00 GEEK