mirror of
https://github.com/soybeanjs/soybean-admin.git
synced 2025-09-27 05:36:43 +08:00
fix(types): 路由守卫修正
This commit is contained in:
parent
99745ad9fa
commit
b42db2ad9e
@ -1,4 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import { useRoute } from 'vue-router';
|
||||
import { computed } from 'vue';
|
||||
import { $t } from '@/locales';
|
||||
|
||||
defineOptions({
|
||||
@ -10,6 +12,11 @@ interface Props {
|
||||
showTitle?: boolean;
|
||||
}
|
||||
|
||||
const route = useRoute();
|
||||
const title = computed(() => {
|
||||
return route.meta.pageType === 'pan' ? $t('system.panTitle') : $t('system.title');
|
||||
});
|
||||
|
||||
withDefaults(defineProps<Props>(), {
|
||||
showTitle: true
|
||||
});
|
||||
@ -19,7 +26,7 @@ withDefaults(defineProps<Props>(), {
|
||||
<RouterLink to="/" class="w-full flex-center nowrap-hidden">
|
||||
<SystemLogo class="text-32px text-primary" />
|
||||
<h2 v-show="showTitle" class="pl-8px text-16px text-primary font-bold transition duration-300 ease-in-out">
|
||||
{{ $t('system.title') }}
|
||||
{{ $t(title) }}
|
||||
</h2>
|
||||
</RouterLink>
|
||||
</template>
|
||||
|
@ -1,6 +1,7 @@
|
||||
const local: App.I18n.Schema = {
|
||||
system: {
|
||||
title: 'SoybeanAdmin',
|
||||
panTitle: 'Tricolor Netdisk',
|
||||
updateTitle: 'System Version Update Notification',
|
||||
updateContent: 'A new version of the system has been detected. Do you want to refresh the page immediately?',
|
||||
updateConfirm: 'Refresh immediately',
|
||||
|
@ -1,6 +1,7 @@
|
||||
const local: App.I18n.Schema = {
|
||||
system: {
|
||||
title: 'Soybean 管理系统',
|
||||
panTitle: '淳享网盘NB版',
|
||||
updateTitle: '系统版本更新通知',
|
||||
updateContent: '检测到系统有新版本发布,是否立即刷新页面?',
|
||||
updateConfirm: '立即刷新',
|
||||
|
@ -83,6 +83,7 @@ export const generatedRoutes: GeneratedRoute[] = [
|
||||
meta: {
|
||||
title: 'pan',
|
||||
i18nKey: 'route.pan',
|
||||
icon: 'lineicons:folder',
|
||||
pageType: 'pan'
|
||||
}
|
||||
}
|
||||
|
1
src/typings/app.d.ts
vendored
1
src/typings/app.d.ts
vendored
@ -290,6 +290,7 @@ declare namespace App {
|
||||
type Schema = {
|
||||
system: {
|
||||
title: string;
|
||||
panTitle: string;
|
||||
updateTitle: string;
|
||||
updateContent: string;
|
||||
updateConfirm: string;
|
||||
|
Loading…
Reference in New Issue
Block a user