Posted on • Originally published atblog.jws.app on
Six ways to use data binding with Vue.js
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 takingDate.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 toDate.now()
?
So, now the value can actually update? 🙂
Please note, this is a republishing of apost that I wrote early last year, so please don't be too harsh.
Top comments(0)
For further actions, you may consider blocking this person and/orreporting abuse