mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-09-05 07:28:37 +08:00
添加重新加载仪表板网格小部件的功能,以清理 GridStack 内部响应式布局缓存
This commit is contained in:
@@ -769,6 +769,7 @@ async function exitDashboardLayoutEditing() {
|
|||||||
|
|
||||||
isLayoutEditing.value = false
|
isLayoutEditing.value = false
|
||||||
await nextTick()
|
await nextTick()
|
||||||
|
await reloadDashboardGridWidgetsFromLayout()
|
||||||
syncDashboardFillContentState()
|
syncDashboardFillContentState()
|
||||||
resizeAutoDashboardItemsToContent()
|
resizeAutoDashboardItemsToContent()
|
||||||
notifyDashboardContentResize()
|
notifyDashboardContentResize()
|
||||||
@@ -1306,6 +1307,14 @@ async function persistCurrentDashboardGridLayout(manualHeightId: string | false
|
|||||||
persistDashboardGridLayout(manualHeightId)
|
persistDashboardGridLayout(manualHeightId)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 清理 GridStack 内部响应式布局缓存,并用当前 Vue 布局状态重新注册已有 DOM 节点。
|
||||||
|
async function reloadDashboardGridWidgetsFromLayout() {
|
||||||
|
if (!dashboardGrid.value) return
|
||||||
|
|
||||||
|
dashboardGrid.value.removeAll(false, false)
|
||||||
|
await syncDashboardGrid()
|
||||||
|
}
|
||||||
|
|
||||||
watch(isLayoutEditing, value => {
|
watch(isLayoutEditing, value => {
|
||||||
updateDashboardGridEditableState(value)
|
updateDashboardGridEditableState(value)
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user