feat: 为 tabbar 的 pagePath 添加明确的联合类型

This commit is contained in:
Utopia
2025-10-29 14:08:40 +08:00
parent b7bf251254
commit b6415c8282
2 changed files with 11 additions and 2 deletions

View File

@@ -13,3 +13,9 @@ export interface IUniUploadFileOptions {
name?: string
formData?: any
}
/** 工具类型:删除字符串开头的第一个斜杠 */
export type RemoveLeadingSlash<S extends string> = S extends `/${infer Rest}` ? Rest : S
/** 工具类型:删除联合类型中每个字符串的第一个斜杠 */
export type RemoveLeadingSlashFromUnion<T extends string> = T extends any ? RemoveLeadingSlash<T> : never