Search
Storage 类用于客户端信息存储,默认使用 localStorage.
Storage
localStorage
export abstract class Storage { abstract clear(): void; abstract getItem(key: string): string | null; abstract removeItem(key: string): void; abstract setItem(key: string, value: string): void; } export class CustomStorage extends Storage { // ... }
setItem()
存储内容。
setItem(key: string, value: string): void
getItem()
获取内容。
getItem(key: string): string | null
removeItem()
删除内容。
removeItem(key: string): void
clear()
清除所有内容。
clear(): void