code refactor

This commit is contained in:
MaysWind
2025-01-21 23:47:22 +08:00
parent e053528abf
commit 58097331da
12 changed files with 19 additions and 56 deletions
+7 -19
View File
@@ -210,8 +210,6 @@ import { ThemeType } from '@/core/theme.ts';
import { isUserScheduledTransactionEnabled } from '@/lib/server_settings.ts';
import { getSystemTheme, setExpenseAndIncomeAmountColor } from '@/lib/ui/common.ts';
type SnackBarType = InstanceType<typeof SnackBar>;
import {
mdiMenu,
mdiHomeOutline,
@@ -235,6 +233,8 @@ import {
mdiLogout
} from '@mdi/js';
type SnackBarType = InstanceType<typeof SnackBar>;
const display = useDisplay();
const theme = useTheme();
const route = useRoute();
@@ -277,21 +277,11 @@ const showVerticalOverlayMenu = ref<boolean>(false);
const showLoading = ref<boolean>(false);
const showMobileQrCode = ref<boolean>(false);
const mdAndDown = computed<boolean>(() => {
return display.mdAndDown.value;
});
const mdAndDown = computed<boolean>(() => display.mdAndDown.value);
const currentRoutePath = computed<string>(() => route.path);
const currentRoutePath = computed<string>(() => {
return route.path;
});
const currentNickName = computed<string>(() => {
return userStore.currentUserNickname || tt('User');
});
const currentUserAvatar = computed<string | null>(() => {
return userStore.getUserAvatarUrl(userStore.currentUserBasicInfo, true);
});
const currentNickName = computed<string>(() => userStore.currentUserNickname || tt('User'));
const currentUserAvatar = computed<string | null>(() => userStore.getUserAvatarUrl(userStore.currentUserBasicInfo, true));
const currentTheme = computed<string>({
get: () => {
@@ -310,9 +300,7 @@ const currentTheme = computed<string>({
}
});
const isEnableApplicationLock = computed<boolean>(() => {
return settingsStore.appSettings.applicationLock;
});
const isEnableApplicationLock = computed<boolean>(() => settingsStore.appSettings.applicationLock);
function handleNavScroll(e: Event): void {
isVerticalNavScrolled.value = (e.target as HTMLElement).scrollTop > 0;