fix: 🐛 点击菜单栏显示/隐藏时transition动画失效的问题

Former-commit-id: b1cbf2e7385ebf5b56e29c466c7d172364d015ae
This commit is contained in:
hxr
2023-08-28 23:06:39 +08:00
parent e23b7c0964
commit a2c858ecca
3 changed files with 4 additions and 4 deletions

View File

@@ -7,7 +7,7 @@ const appStore = useAppStore();
* 左侧菜单栏显示/隐藏 * 左侧菜单栏显示/隐藏
*/ */
function toggleSideBar() { function toggleSideBar() {
appStore.toggleSidebar(true); appStore.toggleSidebar();
} }
</script> </script>

View File

@@ -72,7 +72,7 @@ function handleOutsideClick() {
} }
function toggleSideBar() { function toggleSideBar() {
appStore.toggleSidebar(true); appStore.toggleSidebar();
} }
</script> </script>

View File

@@ -32,9 +32,9 @@ export const useAppStore = defineStore("app", () => {
}); });
// actions // actions
function toggleSidebar(withoutAnimation: boolean) { function toggleSidebar() {
sidebar.opened = !sidebar.opened; sidebar.opened = !sidebar.opened;
sidebar.withoutAnimation = withoutAnimation; sidebar.withoutAnimation = false;
if (sidebar.opened) { if (sidebar.opened) {
sidebarStatus.value = "opened"; sidebarStatus.value = "opened";
} else { } else {