feat 完善注释

This commit is contained in:
Ironsp
2026-10-01 17:24:57 +08:00
parent 2b59f68fd7
commit 9f4a5c7cda
183 changed files with 485 additions and 3615 deletions

View File

@@ -1,6 +1,5 @@
import { computed, onScopeDispose, ref } from 'vue'
/** 倒计时(验证码 60s、二维码失效 4:32 等通用) */
export function useCountDown(defaultSeconds = 60) {
const seconds = ref(0)
let timer: ReturnType<typeof setInterval> | null = null

View File

@@ -1,6 +1,5 @@
import { onMounted, onUnmounted, ref, type Ref } from 'vue'
/** 元素可见性(配合图片懒加载/曝光统计) */
export function useIntersection(
target: Ref<Element | null | undefined>,
options?: IntersectionObserverInit,

View File

@@ -1,6 +1,5 @@
import { ref, type Ref } from 'vue'
/** 请求 loading 状态管理 */
export function useLoading(initial = false): {
loading: Ref<boolean>
withLoading: <T>(fn: () => Promise<T>) => Promise<T>

View File

@@ -1,6 +1,5 @@
import { computed, onMounted, onUnmounted, ref, type ComputedRef, type Ref } from 'vue'
/** 滚动监听/吸顶/回到顶部 */
export function useScroll(threshold = 200): {
scrollY: Ref<number>
isAtTop: ComputedRef<boolean>