From 13e322bb57505b7a498c16d69d3635c06e5a28e2 Mon Sep 17 00:00:00 2001 From: MaysWind Date: Sun, 12 Jan 2025 10:58:12 +0800 Subject: [PATCH] code refactor --- src/views/desktop/tags/ListPage.vue | 14 +++++++------- src/views/mobile/tags/ListPage.vue | 10 +++++----- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/views/desktop/tags/ListPage.vue b/src/views/desktop/tags/ListPage.vue index b4294a7d..631755d2 100644 --- a/src/views/desktop/tags/ListPage.vue +++ b/src/views/desktop/tags/ListPage.vue @@ -270,6 +270,13 @@ const icons = { tag: mdiPound }; +const { tt } = useI18n(); + +const transactionTagsStore = useTransactionTagsStore(); + +const confirmDialog = useTemplateRef('confirmDialog'); +const snackbar = useTemplateRef('snackbar'); + const newTag = ref(null); const editingTag = ref(TransactionTag.createNewTag()); const loading = ref(true); @@ -280,13 +287,6 @@ const tagRemoving = ref>({}); const displayOrderModified = ref(false); const showHidden = ref(false); -const { tt } = useI18n(); - -const transactionTagsStore = useTransactionTagsStore(); - -const confirmDialog = useTemplateRef('confirmDialog'); -const snackbar = useTemplateRef('snackbar'); - const tags = computed(() => transactionTagsStore.allTransactionTags); const noAvailableTag = computed(() => isNoAvailableTag(tags.value, showHidden.value)); const availableTagCount = computed(() => getAvailableTagCount(tags.value, showHidden.value)); diff --git a/src/views/mobile/tags/ListPage.vue b/src/views/mobile/tags/ListPage.vue index 11dda40b..bd653112 100644 --- a/src/views/mobile/tags/ListPage.vue +++ b/src/views/mobile/tags/ListPage.vue @@ -164,6 +164,11 @@ const props = defineProps<{ f7router: Router.Router; }>(); +const { tt } = useI18n(); +const { showToast, routeBackOnError } = useI18nUIComponents(); + +const transactionTagsStore = useTransactionTagsStore(); + const newTag = ref(null); const editingTag = ref(TransactionTag.createNewTag()); const loading = ref(true); @@ -176,11 +181,6 @@ const showDeleteActionSheet = ref(false); const displayOrderModified = ref(false); const displayOrderSaving = ref(false); -const { tt } = useI18n(); -const { showToast, routeBackOnError } = useI18nUIComponents(); - -const transactionTagsStore = useTransactionTagsStore(); - const tags = computed(() => transactionTagsStore.allTransactionTags); const firstShowingId = computed(() => getFirstShowingId(tags.value, showHidden.value)); const lastShowingId = computed(() => getLastShowingId(tags.value, showHidden.value));