fix: 修复侧边栏开合时图表没有刷新 (#253)

This commit is contained in:
悠静萝莉 2022-08-05 16:03:39 +08:00 committed by GitHub
parent 11f0a1259d
commit 75d3e00d7e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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,
() => {