Vue.js Events - Buttons

If you're just getting started with this series of Vue.js posts, you should start with the Vue.js Starter Page.

Using the basic idea of a button click, Vue.js uses "v-on:click='myJavaScriptMethodCallHere()'" to act on the onClick event, and consequently call a method(passYourParam). In the code below you can click a button and add or subtract time to the age value. The code below actually goes one step further and uses the "onmousemove" event and updates the display showing the exact X and Y coords of the mouse in the DIV (pretty cool, and will likely be useful at some point). Notice the Javascript math operators " += " and " -= " to increment and decrement values, respectively.