Merge branch '2.x' into dev

This commit is contained in:
chenjiahan
2020-12-26 15:52:18 +08:00
10 changed files with 96 additions and 31 deletions

View File

@@ -5,7 +5,7 @@ import {
onDeactivated,
onBeforeUnmount,
} from 'vue';
import { raf, cancelRaf } from '../utils';
import { raf, cancelRaf, inBrowser } from '../utils';
export type CurrentTime = {
days: number;
@@ -106,6 +106,12 @@ export function useCountDown(options: UseCountDownOptions) {
};
const tick = () => {
// should not start counting in server
// see: https://github.com/youzan/vant/issues/7807
if (!inBrowser) {
return;
}
if (options.millisecond) {
microTick();
} else {