0
I am starting the use of the Moments library of VUE.JS, I have a message area on my site and I need the date to be shown as: "Posted 5 minutes ago", I was able to show the date with the code below, but I notice that it only updates with refresh, doesn’t get reactive, which I may have done wrong?
<script src="https://momentjs.com/downloads/moment.js"></script>
<div id="app-ask-marketplace">
<div>{{moment(item.date, "YYYY-MM-DD hh:ii").fromNow()}}</div>
</div>
<script>
new Vue({
el:"#app-ask-marketplace",
data : {
},
methods : {
}, mounted(){
}
})
</script>
Ever tried to change the Mounted for updated?
– LeAndrade
Would that be something like? https://jsfiddle.net/7afnyr9j/
– Marconi