uni.setStorageSync('key', [{"note":"男","id":"1","cbm":"1"},{"note":"女","id":"2","cbm":"2"}])
uni.getStorageSync('key')
// 输出 {"0":{"note":"男","id":"1","cbm":"1"},"1":{"note":"女","id":"2","cbm":"2"}}
- 发布:2024-10-31 11:20
- 更新:2024-11-01 19:22
- 阅读:239
产品分类: uniapp/App
PC开发环境操作系统: Windows
PC开发环境操作系统版本号: 11
手机系统: HarmonyOS NEXT
手机系统版本号: HarmonyOS NEXT Developer Beta1
手机厂商: 华为
手机机型: Mate 60
页面类型: vue
vue版本: vue3
打包方式: 离线
项目创建方式: CLI
CLI版本号: 3.0.0-alpha-4030120241024002
示例代码:
操作步骤:
uni.setStorageSync('key', [{"note":"男","id":"1","cbm":"1"},{"note":"女","id":"2","cbm":"2"}])
uni.getStorageSync('key')
uni.setStorageSync('key', [{"note":"男","id":"1","cbm":"1"},{"note":"女","id":"2","cbm":"2"}])
uni.getStorageSync('key')
预期结果:
// 输出 [{"note":"男","id":"1","cbm":"1"},{"note":"女","id":"2","cbm":"2"}]
// 输出 [{"note":"男","id":"1","cbm":"1"},{"note":"女","id":"2","cbm":"2"}]
实际结果:
// 输出 {"0":{"note":"男","id":"1","cbm":"1"},"1":{"note":"女","id":"2","cbm":"2"}}
// 输出 {"0":{"note":"男","id":"1","cbm":"1"},"1":{"note":"女","id":"2","cbm":"2"}}
bug描述:
uni.setStorageSync('key', [{"note":"男","id":"1","cbm":"1"},{"note":"女","id":"2","cbm":"2"}])
uni.getStorageSync('key')
// 输出 {"0":{"note":"男","id":"1","cbm":"1"},"1":{"note":"女","id":"2","cbm":"2"}}
最佳回复
6***@qq.com
请问修复了吗? 为什么我4.33.2024111702-alpha还是有这个问题
2024-11-19 15:40