Skip to content

AppStorage - puppeteerApp

Kind: global class

缓存数据,类似于 localStorage,但是是应用级别的存储,不会因为清除缓存而被清除。

AppStorage.setItem(key, value)

设置存储项 Sets an item in the application storage with the given key and value. If the value is null, the item will be removed.

Kind: static method of AppStorage

ParamTypeDescription
keystringThe key of the item to set or remove.
value*The value of the item to set. If null, the item will be removed.

AppStorage.getItem(key) ⇒ string

获取存储项 Retrieves an item from the application storage with the given key.

Kind: static method of AppStorageReturns: string - - The value of the item associated with the key, or null if the key does not exist.

ParamTypeDescription
keystringThe key of the item to retrieve.

AppStorage.removeItem(key)

删除存储项 Removes an item from the application storage with the given key.

Kind: static method of AppStorage

ParamTypeDescription
keystringThe key of the item to remove.

AppStorage.clear()

清空存储 Clears all items from the application storage.

Kind: static method of AppStorage