From f5281f1e7ecf51a09becd4e7513d340a0b872d55 Mon Sep 17 00:00:00 2001 From: neverland Date: Thu, 24 Dec 2020 19:44:51 +0800 Subject: [PATCH] fix(CountDown): fix ssr memory leak (#7808) --- src/count-down/index.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/count-down/index.js b/src/count-down/index.js index c13d36779..ccda57817 100644 --- a/src/count-down/index.js +++ b/src/count-down/index.js @@ -1,4 +1,4 @@ -import { createNamespace } from '../utils'; +import { createNamespace, inBrowser } from '../utils'; import { raf, cancelRaf } from '../utils/dom/raf'; import { isSameSecond, parseTimeData, parseFormat } from './utils'; @@ -92,6 +92,12 @@ export default createComponent({ }, tick() { + // should not start counting in server + // see: https://github.com/youzan/vant/issues/7807 + if (!inBrowser) { + return; + } + if (this.millisecond) { this.microTick(); } else {