mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
fix(CountDown): fix ssr memory leak (#7808)
This commit is contained in:
parent
b73d9f00a9
commit
f5281f1e7e
@ -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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user