data:function(){ return { time:1567739244120 } }, filters:{ times:function(value){ timestampToTime(value); function timestampToTime(timestamp) { var date = new Date(timestamp); Y = date.getFullYear() + '-'; M = (date.getMonth()+1 < 10 ? '0'+(date.getMonth()+1) : date.getMonth()+1) + '-'; D = date.getDate() + ' '; h = date.getHours() + ':'; m = date.getMinutes() + ':'; s = date.getSeconds(); return Y+M+D+h+m+s; } return timestampToTime(value) } },
html
<div><span>{{item | times}}</span></div>