Vue.js 2 Fundamentals
🚧 PLEASE NOTE: An updated version of this course is available! see the Vue.js 3 Fundamentals with the Options API course. This course is outdated!

Vue Methods

It is handy to be able to run JavaScript expressions directly in the template or a directive sometimes - but not always.

When the expression is getting too verbose or needs to be reused in multiple places, we can extract the logic to a function and fire the function instead. These functions are called methods and allow us to DRY up the code.