# 缓存处理

import Storage from '@sadais/piui-tool/tools/storage'
// or
this.$pi.storage.setStorage(key, value, expiryDate)
1
2
3

# Functions

setStorage(storeKey, value, expiryDate)

保存到缓存中

getStorage(storeKey)Object

获取缓存

# setStorage(storeKey, value, expiryDate)

保存到缓存中

Kind: global function

Param Type Description
storeKey String 缓存键名
value Object 缓存值
expiryDate Date 过期时间

Example

setStorage('USER_INFO', {name: 'aaaa', phone: 123123231}, new Date('2022-02-02'))
1

# getStorage(storeKey) ⇒ Object

获取缓存

Kind: global function
Returns: Object - 缓存信息,若过期则为 null

Param Type Description
storeKey String 缓存键名

Last updated: 2021/9/2 下午5:06:26