[Vuejs]-Moment js fromnow function to vue js laravel

0👍

The context from within templating is only going to have variables that are declared on the Vue’s data. Your options are:

  1. Add a reference to moment to your Vue’s data.
  2. Add a method to your Vue that will do the moment calculation for you.
  3. Add a computed to do the moment calculation for you.

The last one is the recommended route.

Leave a comment