<template>
<view class="container">
复制代码</view>
</template>
<script setup>
import {
ref
} from 'vue';
let Cache = {
practice: [{
curId: 0,
node_id: 1,
lists: [{
answer: 'A',
exam_id: 1,
messages: []
},
{
answer: 'B',
exam_id: 2,
messages: []
}
]
}],
practice1: []
}
uni.setStorageSync("exam3Cache", Cache)
setTimeout(() => {
// let exam3Cache = JSON.parse(JSON.stringify(uni.getStorageSync("exam3Cache")))
let exam3Cache = uni.getStorageSync("exam3Cache")
let flog = exam3Cache.practice.some((item, index) => {
if (item.node_id == 1) { //存在这个练习 覆盖
item.lists.push({
answer: 'C',
exam_id: 3,
messages: []
})
console.log("222", item.lists);
}
return item.node_id == 1
})
}, 2000)
</script>
<style>
.container {
padding: 20px;
font-size: 14px;
line-height: 24px;
}
</style>
2 个回复
最佳回复
DCloud
HBuilderX 4.62.2025041603-alpha 已修复。
DCloud_UNI_OttoJi - 日常回复 uni-app/x 问题,如果艾特我没看到,请主动私信
如之前沟通,目前需要临时加一个条件编译,在 app-harmony 平台额外 parse 一下,感谢反馈。
申庭教育 (作者)
加这个parse可以的
2025-04-09 09:23
申庭教育 (作者)
因为项目使用缓存的地方太多,如果能修复我就不用改。
2025-04-09 09:24