DEV Community

Joe Steinbring
Joe Steinbring

Posted on • Originally published at blog.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 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

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)