Computed Properties

Download vue.js eBook

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)

Related Examples

Stats

126 Contributors: 6
Tuesday, March 7, 2017
Licensed under: CC-BY-SA

Not affiliated with Stack Overflow
Rip Tutorial: info@zzzprojects.com

Download eBook