# getMiniAppCache^8.0

获取当前插件指定键的局部缓存数据(支持weex插件和H5插件,需要插件中有profile.json文件,并且有moduleCode,只在插件内共享数据)

# 请求参数

Prop Type Default Comment
keys Array ['key1','key2',...] 指定缓存数据的键

说明:

  1. 不建议使用localStorage、sessionStrorage,页面间数据不共享
  2. 内存缓存:退出APP,全部内存缓存都被清除

# 接口调用示例

const params = {
    "keys": [
        'name'
    ]	
}
this.$bridge
  .getMiniAppCache(params)
  .then(res => {
    this.$alert(res)
  })
  .catch(err => {
    this.$toast(err)
  })

1
2
3
4
5
6
7
8
9
10
11
12
13
14

# 接口返回示例

{
    "code": 0,
    "msg": "成功"
}


1
2
3
4
5
6
Last Updated: 7/28/2023, 4:33:06 PM