mirror of
https://github.com/m-xlsea/ruoyi-plus-soybean.git
synced 2025-09-24 07:49:47 +08:00
feat(projects): import i18n [引入i18n]
This commit is contained in:
@ -1,15 +1,19 @@
|
||||
<template>
|
||||
<router-link :to="routeHomePath" class="flex-center w-full nowrap-hidden">
|
||||
<system-logo class="text-32px text-primary" />
|
||||
<h2 v-show="showTitle" class="pl-8px text-16px font-bold text-primary transition duration-300 ease-in-out">
|
||||
{{ title }}
|
||||
<h2
|
||||
v-show="showTitle"
|
||||
class="pl-8px text-16px font-bold text-primary transition duration-300 ease-in-out"
|
||||
@click="toggleLocal"
|
||||
>
|
||||
{{ t('message.system.title') }}
|
||||
</h2>
|
||||
</router-link>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { routePath } from '@/router';
|
||||
import { useAppInfo } from '@/composables';
|
||||
import { t, setLocale } from '@/locales';
|
||||
|
||||
defineOptions({ name: 'GlobalLogo' });
|
||||
|
||||
@ -20,8 +24,13 @@ interface Props {
|
||||
|
||||
defineProps<Props>();
|
||||
|
||||
const { title } = useAppInfo();
|
||||
const routeHomePath = routePath('root');
|
||||
|
||||
let flag = true;
|
||||
function toggleLocal() {
|
||||
flag = !flag;
|
||||
setLocale(flag ? 'en' : 'zh-CN');
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped></style>
|
||||
|
Reference in New Issue
Block a user