feat: 优化路由 搭建赛事管理页面基础 处理部分样式问题 完成赛事列表页面搭建

This commit is contained in:
ZhuRui
2026-07-24 15:57:20 +08:00
parent 5523695518
commit 03f1b6c220
35 changed files with 6599 additions and 117 deletions
+3 -6
View File
@@ -1,5 +1,5 @@
// src/hooks/useDebounce.ts
import { watch, onUnmounted } from 'vue';
import { watch, onUnmounted, Ref } from 'vue';
import { useState } from './useState';
export interface UseDebounceOptions {
@@ -8,14 +8,11 @@ export interface UseDebounceOptions {
maxWait?: number;
}
export function useDebounce<T>(
source: any, // Ref<T>
options: number | UseDebounceOptions = {},
) {
export function useDebounce<T>(source: Ref<T>, options: number | UseDebounceOptions = {}) {
const config = typeof options === 'number' ? { delay: options } : options;
const { delay = 300, immediate = false, maxWait } = config;
const [debouncedValue, setDebouncedValue] = useState<T>(source.value);
const [debouncedValue, setDebouncedValue] = useState<T>(source.value as T);
const [isPending, setIsPending] = useState(false);
let timer: any = null;