mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-07-13 16:32:04 +08:00
添加重新加载仪表板网格小部件的功能,以清理 GridStack 内部响应式布局缓存
This commit is contained in:
@@ -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)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user