feat(layout): 菜单支持国际化
All checks were successful
CI/CD Pipeline / playwright (push) Successful in 3m42s
CI/CD Pipeline / build-and-deploy (push) Successful in 4m34s

This commit is contained in:
严浩
2025-10-23 18:15:45 +08:00
parent cec32dceb2
commit 93ecda7617
13 changed files with 76 additions and 23 deletions

View File

@@ -0,0 +1,12 @@
import type { RouteLocalizationFlags } from '@/plugins/router-plugin';
export default {
Root: 'Root',
$Path: '$Path',
Demos: 'Demos',
DemosApiDemo: 'API Demo',
DemosCounterDemo: 'Counter Demo',
DemosI18nDemo: 'i18n Demo',
DemosWebsocketDemo: 'WebSocket Demo',
Home: 'Home',
} satisfies RouteLocalizationFlags;

View File

@@ -0,0 +1,12 @@
import type { RouteLocalizationFlags } from '@/plugins/router-plugin';
export default {
Root: '根 (Gēn)',
$Path: '$Path',
Demos: '示例演示',
DemosApiDemo: 'API 调用示例',
DemosCounterDemo: '点击计数器',
DemosI18nDemo: '国际化示例',
DemosWebsocketDemo: 'WebSocket 示例',
Home: '首页',
} satisfies RouteLocalizationFlags;

View File

@@ -2,9 +2,7 @@
import { ref } from 'vue';
definePage({
meta: {
title: 'API 调用示例',
},
meta: {},
});
// ========== API 模块 ==========

View File

@@ -3,9 +3,7 @@ import { ref } from 'vue';
import { NButton } from 'naive-ui';
definePage({
meta: {
title: '点击计数器',
},
meta: {},
});
// ========== 计数器模块 ==========

View File

@@ -1,8 +1,6 @@
<script setup lang="ts">
definePage({
meta: {
title: '国际化示例',
},
meta: {},
});
const { t, locale } = useI18n();

View File

@@ -1,4 +1,4 @@
<script setup lang="ts">
definePage({ meta: { title: '示例演示', link: false } });
definePage({ meta: { link: false } });
</script>
<template><div>此页面文件仅用于在侧边栏菜单中显示示例演示分组标题</div></template>

View File

@@ -2,9 +2,7 @@
import { ref, onUnmounted, computed, nextTick } from 'vue';
definePage({
meta: {
title: 'WebSocket 示例',
},
meta: {},
});
// ========== WebSocket 模块 ==========