In 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
Above you export and below the script tag import moment. Then add moment as a variable in the return attribute.
//Above the export and below the script open tag
var moment = require('moment');
//in the data return add
Now to use moment you simply do this within the component
You can view this on YouTube