Vue.js Computed Properties

30% OFF - 9th Anniversary discount on Entity Framework Extensions until December 15 with code: ZZZANNIVERSARY9

Remarks

Data vs Computed Properties

The main use-case difference for the data and computed properties of a Vue instance is dependent on the potential state or probability of changing of the data. When deciding what category a certain object should be, these questions might help:

  • Is this a constant value? (data)
  • Does this have the possibility to change? (computed or data)
  • Is the value of it reliant on the value of other data? (computed)
  • Does it need additional data or calculations to be complete before being used? (computed)
  • Will the value only change under certain circumstances? (data)


Got any Vue.js Question?