一直这样

- 发布:2020-09-24 01:13
- 更新:2020-09-25 12:01
- 阅读:725
产品分类: uniapp/App
PC开发环境操作系统: Windows
PC开发环境操作系统版本号: win10
HBuilderX类型: 正式
HBuilderX版本号: 2.8.11
手机系统: iOS
手机系统版本号: iOS 13.2
手机厂商: 苹果
手机机型: 6p
页面类型: vue
打包方式: 云端
项目创建方式: HBuilderX
操作步骤:
预期结果:
处理
处理
实际结果:
报错
报错
bug描述:
真机测试的
count() {
let res = uni.getStorageInfoSync();
let sizeStore = res.currentSize;
return (sizeStore / 1024 / 1024).toFixed(2) + 'Mb';
}
Error in onReady hook: "TypeError: Cannot read property 'length' of null"
错误栈
TypeError: Cannot read property 'length' of null
at cs ()
at getStorageInfoSync ()
at Object.getStorageInfoSync ()
at uniCache.count ()
at onReady (setting.vue:50)
at Ke ()
at o.Hr [as __call_hook] ()
at Ou ()
at o.mounted ()
at Ke () " uni-app:///App.vue:56"
指向这一段代码,我都没用到length属性.所以问题就在uni.getStorageInfoSync()中
d***@qq.com (作者)
我是加了try cache就没错了, 问题可能还在
2020-09-25 12:13