Use structuredClone instead of JSON.parse(JSON.stringify()) (S7784)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-10 00:28:30 +08:00
parent 3768c6e5ec
commit 2b0dadedd4
9 changed files with 32 additions and 32 deletions

View File

@@ -586,7 +586,7 @@ const isCompareDisabledButton = computed(() => {
const reallyDeleteData = computed(() => {
let result = [];
if (store.allFiles.length !== 0) {
result = JSON.parse(JSON.stringify(store.allFiles));
result = structuredClone(store.allFiles);
result = result.filter((file) => file.is_deleted === true);
}
return result;
@@ -602,7 +602,7 @@ watch(filesTag, (newValue) => {
watch(allFiles, (newValue) => {
if (newValue !== null)
compareData.value = JSON.parse(JSON.stringify(newValue));
compareData.value = structuredClone(newValue);
});
watch(