code refactor

This commit is contained in:
MaysWind
2025-01-18 22:45:16 +08:00
parent 20e95e35aa
commit c675057ab1
17 changed files with 58 additions and 68 deletions
-1
View File
@@ -118,7 +118,6 @@ import type { LanguageOption } from '@/locales/index.ts';
import { useI18n } from '@/locales/helpers.ts';
import { useUnlockPageBase } from '@/views/base/UnlockPageBase.ts';
import { useSettingsStore } from '@/stores/setting.ts';
import { useUserStore } from '@/stores/user.ts';
@@ -87,7 +87,6 @@ import logger from '@/lib/logger.ts';
type SnackBarType = InstanceType<typeof SnackBar>;
const { tt } = useI18n();
const { isSupportedWebAuthn, isEnableApplicationLock, isEnableApplicationLockWebAuthn } = useAppLockPageBase();
const settingsStore = useSettingsStore();
@@ -82,16 +82,16 @@ import { categorizedArrayToPlainArray } from '@/lib/common.ts';
type SnackBarType = InstanceType<typeof SnackBar>;
const { tt, getCurrentLanguageTag, getAllLanguageOptions, getAllTransactionDefaultCategories, getLanguageInfo } = useI18n();
const transactionCategoriesStore = useTransactionCategoriesStore();
const props = defineProps<{
categoryType: CategoryType;
persistent?: boolean;
show: boolean;
}>();
const { tt, getCurrentLanguageTag, getAllLanguageOptions, getAllTransactionDefaultCategories, getLanguageInfo } = useI18n();
const transactionCategoriesStore = useTransactionCategoriesStore();
const emit = defineEmits<{
(e: 'update:show', value: boolean): void;
(e: 'category:saved', event: { message: string }): void;
+4 -4
View File
@@ -256,6 +256,10 @@ import {
type ConfirmDialogType = InstanceType<typeof ConfirmDialog>;
type SnackBarType = InstanceType<typeof SnackBar>;
const { tt } = useI18n();
const transactionTagsStore = useTransactionTagsStore();
const icons = {
refresh: mdiRefresh,
add: mdiPlus,
@@ -270,10 +274,6 @@ const icons = {
tag: mdiPound
};
const { tt } = useI18n();
const transactionTagsStore = useTransactionTagsStore();
const confirmDialog = useTemplateRef<ConfirmDialogType>('confirmDialog');
const snackbar = useTemplateRef<SnackBarType>('snackbar');