Home > utils > LocalStoragePlus
本地存储增强。
已兼容小程序。
Signature:
export declare class LocalStoragePlus<T extends JsonValue>
| Constructor | Modifiers | Description |
|---|---|---|
| (constructor)(options) | Constructs a new instance of the LocalStoragePlus class |
| Method | Modifiers | Description |
|---|---|---|
| clear() | static |
清空本地存储。 |
| decrease(value, options) | 自减。 | |
| decrease(key, value, options) | static |
将本地存储的值减少给定值,若本地存储不存在,则初始化为 0 后操作。 |
| get(options) | 获取值。 | |
| get(key, options) | static |
获取本地存储。 |
| has(options) | 是否存在值。 | |
| has(key, options) | static |
是否存在本地存储。 |
| increase(value, options) | 自增。 | |
| increase(key, value, options) | static |
将本地存储的值增加给定值,若本地存储不存在,则初始化为 0 后操作。 |
| remove() | 删除值。 | |
| remove(key) | static |
删除本地存储。 |
| set(value, options) | 设置值。 | |
| set(key, value, options) | static |
设置本地存储。 |