阵浊秀
阵浊秀
  • 发布:2025-07-01 17:01
  • 更新:2025-07-01 17:13
  • 阅读:56

【报Bug】鸿蒙uni.setStorage VUE3存储数据的时候无法存储响应式对象的value

分类:鸿蒙Next

产品分类: uniapp/App

PC开发环境操作系统: Windows

PC开发环境操作系统版本号: win11

HBuilderX类型: 正式

HBuilderX版本号: 4.66

手机系统: HarmonyOS NEXT

手机系统版本号: HarmonyOS 5.0.5

手机厂商: 华为

手机机型: mate 70

页面类型: vue

vue版本: vue3

打包方式: 云端

项目创建方式: HBuilderX

操作步骤:

真机运行就行了

预期结果:

可以正常存储响应式对象的value

实际结果:

无法存储响应式对象的value

bug描述:

<script setup>  
let historyList = ref([])  
let uniqueArr = [1]  
historyList.value = uniqueArr  

        uni.setStorage({  
            key: 'expressQueryList',  
            data: historyList.value,  
            success: function () {  
                console.log('success');  
                uni.getStorage({  
                    key: 'expressQueryList',  
                    success:(SSS)=>{  
                        console.log(SSS)  
                    }  
                })  
            },  
            fail(err) {  
                console.log(err)  
            }  
        });  
        console.log(uni.getStorageSync('expressQueryList'))  
</script>

history.value 无法存储,uniqueArr可以存储

2025-07-01 17:01 负责人:无 分享
已邀请:
DCloud_UNI_yuhe

DCloud_UNI_yuhe

更新到 4.74 alpha 可以解决这个问题

要回复问题请先登录注册