Commit 966a179c authored by 赵啸非's avatar 赵啸非

修改配置文件

parent 1c9c43ba
......@@ -38,7 +38,7 @@
<div class="article-header">
<h2><router-link :to="{name:'newsDetails',params:{newsId:article.id}}" rel="">{{article.title}}</router-link></h2>
<ul class="article--meta">
<li class="article--meta_item -date">{{$moment(article.createTime).format("YYYY-MM-DD HH:mm")}}</li>
<li class="article--meta_item -date">{{formatterDate(article.createTime)}}</li>
</ul>
</div>
<div class="article--content">
......@@ -123,7 +123,22 @@ export default {
this.pageIndex = p;
this.getArticle(p)
}
}
},
formatterDate(time) {
if (!time) return '';
let date = new Date(Number(time));
let Y = date.getFullYear() + '-';
let M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-';
let D = panLeft(date.getDate()) + ' ';
let h = panLeft(date.getHours()) + ':';
let m = panLeft(date.getMinutes()) + ':';
let s = panLeft(date.getSeconds());
return Y + M + D + h + m + s;
},
panLeft(num) {
return num < 10 ? '0' + num : num;
}
}
}
</script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment