From 81d6c63321361fcab63428d8c4b203b7425320a0 Mon Sep 17 00:00:00 2001 From: reco_luan Date: Mon, 19 Aug 2019 20:24:19 +0800 Subject: [PATCH] fix: date is NaN at timeline --- components/TimeLine.vue | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/components/TimeLine.vue b/components/TimeLine.vue index 0a47c3b..deaab97 100644 --- a/components/TimeLine.vue +++ b/components/TimeLine.vue @@ -6,7 +6,7 @@

{{item.year}}

@@ -75,6 +75,8 @@ export default { }, // 时间格式化 dateFormat (date, type) { + date = date.replace(/-/g,'/') + const dateObj = new Date(date) const dateObj = new Date(date) const year = dateObj.getFullYear() const mon = dateObj.getMonth() + 1