# getItem
APP本地化存储取值
# 调用方式
getItem(key, callback)
1
无直接返回值;不要对调用结果使用 then/catch。
# 请求参数
| 参数 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
| key | String | Y | — | 需要读取的存储键 |
| callback | Function | Y | — | 接收 storage.getItem 的原生事件结果 |
# 接口调用示例
this.$bridge.getItem('example-key', event => {
console.log(event)
})
1
2
3
2
3
# 返回参数
无直接返回值;结果由 callback 接收,不返回 Promise。