code refactor

This commit is contained in:
MaysWind
2023-08-13 15:18:38 +08:00
parent 66f0b38008
commit 957bcf790f
3 changed files with 22 additions and 24 deletions
+4 -12
View File
@@ -177,6 +177,7 @@
import { mapStores } from 'pinia';
import { useRootStore } from '@/stores/index.js';
import { useSettingsStore } from '@/stores/setting.js';
import { useUserStore } from '@/stores/user.js';
import { useTransactionCategoriesStore } from '@/stores/transactionCategory.js';
import { useExchangeRatesStore } from '@/stores/exchangeRates.js';
@@ -188,20 +189,11 @@ export default {
'f7router'
],
data() {
const self = this;
const settingsStore = useSettingsStore();
const userStore = useUserStore();
const newUser = userStore.generateNewUserInfo(this.$locale.getCurrentLanguageCode());
return {
user: {
username: '',
password: '',
confirmPassword: '',
email: '',
nickname: '',
language: self.$locale.getCurrentLanguageCode(),
defaultCurrency: settingsStore.localeDefaultSettings.currency,
firstDayOfWeek: settingsStore.localeDefaultSettings.firstDayOfWeek,
},
user: newUser,
submitting: false,
usePresetCategories: false,
showPresetCategories: false,