useLocalStorage
响应式的LocalStorage。
使用方法
请参考 useStorage
类型声明
typescript
export declare function useLocalStorage(
key: string,
initialValue: MaybeRefOrGetter<string>,
options?: UseStorageOptions<string>,
): RemovableRef<string>
export declare function useLocalStorage(
key: string,
initialValue: MaybeRefOrGetter<boolean>,
options?: UseStorageOptions<boolean>,
): RemovableRef<boolean>
export declare function useLocalStorage(
key: string,
initialValue: MaybeRefOrGetter<number>,
options?: UseStorageOptions<number>,
): RemovableRef<number>
export declare function useLocalStorage<T>(
key: string,
initialValue: MaybeRefOrGetter<T>,
options?: UseStorageOptions<T>,
): RemovableRef<T>
export declare function useLocalStorage<T = unknown>(
key: string,
initialValue: MaybeRefOrGetter<null>,
options?: UseStorageOptions<T>,
): RemovableRef<T>
Source
贡献者
Anthony Fu
丶远方
Antério Vieira
Anthony Fu
ntnyq
Jelf
Shinigami
Pig Fang
Alex Kozack
变更日志
v10.0.0-beta.4
on 4/13/20234d757
- feat(types)!: rename MaybeComputedRef
to MaybeRefOrGetter