Thanks, Drew!
So computed is more like a method to update data to be dynamic?
When would we want to use methods or computed?
Exactly!
Another important thing to note is that computed properties are available the same as properties in your data store
So
data() { return { number: 1 } }
is the same as
computed: { number() { return 1 } }
Both would be available with using this.number or {{ number }}
this.number
{{ number }}
But, if you ever needed number to update based on something else in the component, then the computed would do it auto-magically.
Thank you, Drew!!! 😃
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Thanks, Drew!
So computed is more like a method to update data to be dynamic?
When would we want to use methods or computed?
Exactly!
Another important thing to note is that computed properties are available the same as properties in your data store
So
is the same as
Both would be available with using
this.number
or{{ number }}
But, if you ever needed number to update based on something else in the component, then the computed would do it auto-magically.
Thank you, Drew!!! 😃