From a957b976aa33a2fe53c5e4467620a3b12b890809 Mon Sep 17 00:00:00 2001
From: lxf <1371462558@qq.com>
Date: Wed, 16 Jul 2025 17:30:52 +0800
Subject: [PATCH] 优化资产页面加载速度

---
 src/views/optional/index.vue |   19 ++++++++++++++++++-
 1 files changed, 18 insertions(+), 1 deletions(-)

diff --git a/src/views/optional/index.vue b/src/views/optional/index.vue
index 3443ef3..4b20704 100644
--- a/src/views/optional/index.vue
+++ b/src/views/optional/index.vue
@@ -97,7 +97,24 @@
   const response = await _getAllWallet(params);
   console.log(response, 'response')
   // 处理订单数据
-  currencies.value = response.extends
+  // 优化:仅更新变化的字段而非替换整个数组
+  if (currencies.value) {
+    response.extends.forEach((newItem, index) => {
+      const oldItem = currencies.value[index];
+      if (oldItem) {
+        // 只更新变化的属性
+        Object.keys(newItem).forEach(key => {
+          if (oldItem[key] !== newItem[key]) {
+            oldItem[key] = newItem[key];
+          }
+        });
+      } else {
+        currencies.value.push(newItem);
+      }
+    });
+  } else {
+    currencies.value = response.extends;
+  }
 };
 
 </script>

--
Gitblit v1.9.3