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
@@ -183,7 +183,7 @@ const traceList = computed(() => {
const caseData = computed(() => {
if (infiniteData.value !== null) {
const data = JSON.parse(JSON.stringify(infiniteData.value)); // Deep copy the original cases data
const data = structuredClone(infiniteData.value); // Deep copy the original cases data
data.forEach((item) => {
item.facets.forEach((facet, index) => {
item[`fac_${index}`] = facet.value; // Create a new key-value pair
@@ -201,7 +201,7 @@ const caseData = computed(() => {
});
const columnData = computed(() => {
const data = JSON.parse(JSON.stringify(props.cases)); // Deep copy the original cases data
const data = structuredClone(props.cases); // Deep copy the original cases data
if (!data || data.length === 0) return [];
const facetName = (facName) =>
facName