diff --git a/src/pages/dashboard/base/components/MiddleChart.vue b/src/pages/dashboard/base/components/MiddleChart.vue index 4f16bb8..1c5bea5 100644 --- a/src/pages/dashboard/base/components/MiddleChart.vue +++ b/src/pages/dashboard/base/components/MiddleChart.vue @@ -130,6 +130,7 @@ onUnmounted(() => { onDeactivated(() => { storeModeWatch(); storeBrandThemeWatch(); + storeSidebarCompactWatch(); }); const currentMonth = ref(getThisMonth()); @@ -141,6 +142,21 @@ const storeBrandThemeWatch = watch( }, ); +const storeSidebarCompactWatch = watch( + () => store.isSidebarCompact, + () => { + if (store.isSidebarCompact) { + nextTick(() => { + updateContainer(); + }); + } else { + setTimeout(() => { + updateContainer(); + }, 180); + } + }, +); + const storeModeWatch = watch( () => store.mode, () => {