feat(layout): 菜单支持国际化
This commit is contained in:
12
src/pages/_page-title-locales/en-US.ts
Normal file
12
src/pages/_page-title-locales/en-US.ts
Normal 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;
|
||||
12
src/pages/_page-title-locales/zh-CN.ts
Normal file
12
src/pages/_page-title-locales/zh-CN.ts
Normal 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;
|
||||
@@ -2,9 +2,7 @@
|
||||
import { ref } from 'vue';
|
||||
|
||||
definePage({
|
||||
meta: {
|
||||
title: 'API 调用示例',
|
||||
},
|
||||
meta: {},
|
||||
});
|
||||
|
||||
// ========== API 模块 ==========
|
||||
|
||||
@@ -3,9 +3,7 @@ import { ref } from 'vue';
|
||||
import { NButton } from 'naive-ui';
|
||||
|
||||
definePage({
|
||||
meta: {
|
||||
title: '点击计数器',
|
||||
},
|
||||
meta: {},
|
||||
});
|
||||
|
||||
// ========== 计数器模块 ==========
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
definePage({
|
||||
meta: {
|
||||
title: '国际化示例',
|
||||
},
|
||||
meta: {},
|
||||
});
|
||||
const { t, locale } = useI18n();
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<script setup lang="ts">
|
||||
definePage({ meta: { title: '示例演示', link: false } });
|
||||
definePage({ meta: { link: false } });
|
||||
</script>
|
||||
<template><div>此页面文件仅用于在侧边栏菜单中显示示例演示分组标题</div></template>
|
||||
|
||||
@@ -2,9 +2,7 @@
|
||||
import { ref, onUnmounted, computed, nextTick } from 'vue';
|
||||
|
||||
definePage({
|
||||
meta: {
|
||||
title: 'WebSocket 示例',
|
||||
},
|
||||
meta: {},
|
||||
});
|
||||
|
||||
// ========== WebSocket 模块 ==========
|
||||
|
||||
Reference in New Issue
Block a user