perf: 优化中英文翻译与切换

This commit is contained in:
xiaojunnuo
2025-06-28 23:57:01 +08:00
parent 082f47663d
commit acaa8b1731
43 changed files with 4121 additions and 4175 deletions
@@ -1,15 +1,15 @@
<script setup lang="ts">
import type { VbenFormSchema } from '/@/vben/form-ui';
import type { VbenFormSchema } from "/@/vben/form-ui";
import { computed, reactive } from 'vue';
import { useRouter } from 'vue-router';
import { computed, reactive } from "vue";
import { useRouter } from "vue-router";
import { $t } from '/@/locales';
import { $t } from "/@/locales";
import { useVbenForm } from '/@/vben/form-ui';
import { VbenButton } from '/@/vben/shadcn-ui';
import { useVbenForm } from "/@/vben/form-ui";
import { VbenButton } from "/@/vben/shadcn-ui";
import Title from './auth-title.vue';
import Title from "./auth-title.vue";
interface Props {
formSchema: VbenFormSchema[];
@@ -36,15 +36,15 @@ interface Props {
}
defineOptions({
name: 'ForgetPassword',
name: "ForgetPassword",
});
const props = withDefaults(defineProps<Props>(), {
loading: false,
loginPath: '/auth/login',
submitButtonText: '',
subTitle: '',
title: '',
loginPath: "/auth/login",
submitButtonText: "",
subTitle: "",
title: "",
});
const emit = defineEmits<{
@@ -59,7 +59,7 @@ const [Form, formApi] = useVbenForm(
},
schema: computed(() => props.formSchema),
showDefaultActions: false,
}),
})
);
const router = useRouter();
@@ -68,7 +68,7 @@ async function handleSubmit() {
const { valid } = await formApi.validate();
const values = await formApi.getValues();
if (valid) {
emit('submit', values);
emit("submit", values);
}
}
@@ -84,12 +84,10 @@ defineExpose({
<template>
<div>
<Title>
<slot name="title">
{{ title || $t('authentication.forgetPassword') }} 🤦🏻
</slot>
<slot name="title"> {{ title || $t("authentication.forgetPassword") }} 🤦🏻 </slot>
<template #desc>
<slot name="subTitle">
{{ subTitle || $t('authentication.forgetPasswordSubtitle') }}
{{ subTitle || $t("authentication.forgetPasswordSubtitle") }}
</slot>
</template>
</Title>
@@ -105,11 +103,11 @@ defineExpose({
@click="handleSubmit"
>
<slot name="submitButtonText">
{{ submitButtonText || $t('authentication.sendResetLink') }}
{{ submitButtonText || $t("authentication.sendResetLink") }}
</slot>
</VbenButton>
<VbenButton class="mt-4 w-full" variant="outline" @click="goToLogin()">
{{ $t('common.back') }}
{{ $t("common.back") }}
</VbenButton>
</div>
</div>