主题
useLocalStorage
反应式 LocalStorage。
¥Reactive LocalStorage.
用法
¥Usage
请参阅 useStorage
¥Please refer to 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>