跳到主要内容

useLocalStorage

分类
导出大小
2.03 kB
上次更改
3 个月前
相关

响应式的 LocalStorage

用法

请参考 useStorage

类型声明

ts
export declare function 
useLocalStorage
(
key
:
MaybeRefOrGetter
<string>,
initialValue
:
MaybeRefOrGetter
<string>,
options
?:
UseStorageOptions
<string>,
):
RemovableRef
<string>
export declare function
useLocalStorage
(
key
:
MaybeRefOrGetter
<string>,
initialValue
:
MaybeRefOrGetter
<boolean>,
options
?:
UseStorageOptions
<boolean>,
):
RemovableRef
<boolean>
export declare function
useLocalStorage
(
key
:
MaybeRefOrGetter
<string>,
initialValue
:
MaybeRefOrGetter
<number>,
options
?:
UseStorageOptions
<number>,
):
RemovableRef
<number>
export declare function
useLocalStorage
<
T
>(
key
:
MaybeRefOrGetter
<string>,
initialValue
:
MaybeRefOrGetter
<
T
>,
options
?:
UseStorageOptions
<
T
>,
):
RemovableRef
<
T
>
export declare function
useLocalStorage
<
T
= unknown>(
key
:
MaybeRefOrGetter
<string>,
initialValue
:
MaybeRefOrGetter
<null>,
options
?:
UseStorageOptions
<
T
>,
):
RemovableRef
<
T
>

来源

源文件文档

贡献者

Anthony Fu
Antério Vieira
RYGRIT
Yauheni Vasiukevich
Anthony Fu
ntnyq
Jelf
Shinigami
Pig Fang
Alex Kozack

更新日志

v13.6.0
2d179 - 修复 (types): 使用 Vue 原生 MaybeRefMaybeRefOrGetter 而不是自定义类型 (#4913)
v12.4.0
eb679 - 特性 (useStorage): 使存储键成为响应式 (#4464)

根据 MIT 许可证发布。