From 4492e211bbe3ea8e320480a98804b8fb47b481be Mon Sep 17 00:00:00 2001 From: jxxghp Date: Mon, 29 Jun 2026 22:09:13 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=87=8D=E6=96=B0=E5=8A=A0?= =?UTF-8?q?=E8=BD=BD=E4=BB=AA=E8=A1=A8=E6=9D=BF=E7=BD=91=E6=A0=BC=E5=B0=8F?= =?UTF-8?q?=E9=83=A8=E4=BB=B6=E7=9A=84=E5=8A=9F=E8=83=BD=EF=BC=8C=E4=BB=A5?= =?UTF-8?q?=E6=B8=85=E7=90=86=20GridStack=20=E5=86=85=E9=83=A8=E5=93=8D?= =?UTF-8?q?=E5=BA=94=E5=BC=8F=E5=B8=83=E5=B1=80=E7=BC=93=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/dashboard.vue | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/pages/dashboard.vue b/src/pages/dashboard.vue index 5a5d7a28..616631d1 100644 --- a/src/pages/dashboard.vue +++ b/src/pages/dashboard.vue @@ -769,6 +769,7 @@ async function exitDashboardLayoutEditing() { isLayoutEditing.value = false await nextTick() + await reloadDashboardGridWidgetsFromLayout() syncDashboardFillContentState() resizeAutoDashboardItemsToContent() notifyDashboardContentResize() @@ -1306,6 +1307,14 @@ async function persistCurrentDashboardGridLayout(manualHeightId: string | false persistDashboardGridLayout(manualHeightId) } +// 清理 GridStack 内部响应式布局缓存,并用当前 Vue 布局状态重新注册已有 DOM 节点。 +async function reloadDashboardGridWidgetsFromLayout() { + if (!dashboardGrid.value) return + + dashboardGrid.value.removeAll(false, false) + await syncDashboardGrid() +} + watch(isLayoutEditing, value => { updateDashboardGridEditableState(value) })