This is going to be a pretty quick post. This week, I figured that we would look at computed properties and methods.
In the above example, we are taking Date.now() and outputting it to the screen four ways:
-
- Directly as
{{Date.now()}}
- As the variable
time
- As a computed value
- As a method
- Directly as
What is the functional difference between them? In this case, very little. 🙂
So, what if we bind to our component’s data instead of to Date.now()
?
So, now the value can actually update? 🙂
Please note, this is a republishing of a post that I wrote early last year, so please don't be too harsh.
Top comments (0)