asp-smart-ui-plus-test
Version:
A Component Library for Vue 3
12 lines (11 loc) • 466 B
TypeScript
import type { Ref } from 'vue';
/**
* 一个 Vue composable 函数,提供倒计时功能。
* @param initialCountDown - 初始倒计时值,以秒为单位。
* @param initialText - 初始显示的文本。
* @returns 一个对象,包含倒计时的剩余秒数,显示的文本,以及开始倒计时的函数。
*/
export default function useCountDown(initialCountDown?: number): {
remainingSeconds: Ref<number>;
startCountDown: () => void;
};