diff --git a/pages/demo/status/countdown.uvue b/pages/demo/status/countdown.uvue index 8390160..8335e25 100644 --- a/pages/demo/status/countdown.uvue +++ b/pages/demo/status/countdown.uvue @@ -33,6 +33,10 @@ + + + + import { t } from "@/locale"; import DemoItem from "../components/item.uvue"; -import { ref } from "vue"; +import { onMounted, ref } from "vue"; import { dayUts, isDark, parseClass } from "@/cool"; import { useUi } from "@/uni_modules/cool-ui"; @@ -69,4 +73,12 @@ function onDone() { message: "倒计时完成" }); } + +const countdownRef = ref(null); + +onMounted(() => { + setTimeout(() => { + countdownRef.value!.next(); + }, 3000); +}); diff --git a/uni_modules/cool-ui/components/cl-countdown/cl-countdown.uvue b/uni_modules/cool-ui/components/cl-countdown/cl-countdown.uvue index c1fd041..2be0d89 100644 --- a/uni_modules/cool-ui/components/cl-countdown/cl-countdown.uvue +++ b/uni_modules/cool-ui/components/cl-countdown/cl-countdown.uvue @@ -14,7 +14,7 @@ diff --git a/uni_modules/cool-ui/components/cl-countdown/props.ts b/uni_modules/cool-ui/components/cl-countdown/props.ts index 6a0c2d1..32682f2 100644 --- a/uni_modules/cool-ui/components/cl-countdown/props.ts +++ b/uni_modules/cool-ui/components/cl-countdown/props.ts @@ -16,4 +16,5 @@ export type ClCountdownProps = { minute?: number; second?: number; datetime?: Date | string; + auto?: boolean; };