How to use moment.js in Vue.js and Laravel 5In this project I wanted to show when how old the post was since I uploaded it. To do this I wanted to use the very popular package moment.js. Here is the process.
npm install moment
Vue.js ComponentAbove you export and below the script tag import moment. Then add moment as a variable in the return attribute.
Now to use moment you simply do this within the component
//Above the export and below the script open tag var moment = require('moment'); //in the data return add moment: moment
You can view this on YouTube