From 881a796afdc57e0c1fb30fd2a5ae7440abe6e212 Mon Sep 17 00:00:00 2001 From: tangjinzhou <415800467@qq.com> Date: Thu, 5 Aug 2021 14:36:50 +0800 Subject: [PATCH] perf: statistic countdown --- components/statistic/Countdown.tsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/components/statistic/Countdown.tsx b/components/statistic/Countdown.tsx index 393a1f83a..963396a9b 100644 --- a/components/statistic/Countdown.tsx +++ b/components/statistic/Countdown.tsx @@ -1,6 +1,4 @@ import { defineComponent, onBeforeUnmount, onMounted, onUpdated, ref } from 'vue'; -import moment from 'moment'; -import interopDefault from '../_util/interopDefault'; import initDefaultProps from '../_util/props-util/initDefaultProps'; import Statistic, { statisticProps } from './Statistic'; import type { countdownValueType, FormatConfig } from './utils'; @@ -9,7 +7,7 @@ import { formatCountdown as formatCD } from './utils'; const REFRESH_INTERVAL = 1000 / 30; function getTime(value?: countdownValueType) { - return interopDefault(moment)(value).valueOf(); + return new Date(value as any).getTime(); } export default defineComponent({