特性: 中英文菜单切换

This commit is contained in:
zouzhibing 2023-03-02 10:30:35 +08:00
parent 76cb2b7890
commit bb4b2d747a
10 changed files with 24 additions and 14 deletions

View File

@ -25,15 +25,19 @@ export default {
route:{
home:'Home',
visualizationChart:'Visualization Chart',
Table:'Super Table',
superTable:'Super Table',
form:'Super Form',
dataScreen:'Data Screen',
chatBox:'Chat Box',
expansionComponents:'Components',
commonComponents:'Components',
functionPage:'Function Page',
nested: 'Nested Routes',
excel: 'Excel',
zip: 'Zip',
errorPages: 'Error Pages',
clipboardIndex: 'Clipboard',
SystemManagement: 'System Management',
systemManagement: 'System Management',
externalLink: 'External Link',
},
tagsView: {
refresh:'Refresh Current',

View File

@ -25,15 +25,19 @@ export default {
route:{
home:'首页',
visualizationChart:'可视化图表',
Table:'超级表格',
superTable:'超级表格',
form:'超级表单',
dataScreen:'可视化大屏',
chatBox:'聊天框',
expansionComponents:'扩展组件',
commonComponents:'常用组件',
functionPage:'功能页面',
nested: '路由嵌套',
excel: 'Excel&Zip',
zip: 'Zip',
errorPages: '错误页面',
clipboardIndex: '剪贴板',
SystemManagement: '剪贴板',
systemManagement: '系统管理',
externalLink: '外部链接',
},
tagsView: {
refresh:'刷新当页',

View File

@ -6,13 +6,14 @@
<component :is="subItem?.meta?.icon"></component>
</el-icon>
<template #title>
<span>{{ subItem?.meta?.title }}</span>
<span>{{ generateTitle(subItem) }}</span>
</template>
</el-menu-item>
</template>
<script setup lang="ts">
import { ref } from "vue";
import { generateTitle } from '@/utils/i18n'
import { useRouter } from "vue-router";
import { isExternal } from "@/utils/validate";

View File

@ -11,7 +11,7 @@
<el-icon>
<component :is="subItem?.meta?.icon"></component>
</el-icon>
<span>{{ subItem?.meta?.title }}</span>
<span>{{ generateTitle(subItem) }}</span>
</template>
<SubMenu :menuList="subItem.children" />
</el-sub-menu>
@ -22,6 +22,7 @@
<script setup lang="ts">
import { ref } from "vue";
import MenuItem from './MenuItem.vue'
import { generateTitle } from '@/utils/i18n'
let props = defineProps({
menuList:{

View File

@ -6,7 +6,7 @@ const externalLink = [{
path: '/external-link',
component: Layout,
redirect: '/external-link/wechat',
name: 'external-link',
name: 'externalLink',
meta: {
title: '外部链接',
icon: 'link'

View File

@ -7,7 +7,7 @@ const functionPageRouter = [{
path: '/function-page',
component: Layout,
redirect: '/function-page/404',
name: 'function-page',
name: 'functionPage',
meta: {
title: '功能页面',
icon: 'ElementPlus'

View File

@ -6,7 +6,7 @@ const othersRouter = [{
path: '/other',
component: Layout,
redirect: '/other/clipboard',
name: 'other',
name: 'commonComponents',
meta: {
title: '常用组件',
icon: 'management'

View File

@ -6,7 +6,7 @@ const systemRouter = [{
path: '/system',
component: Layout,
redirect: '/system/user',
name: 'system',
name: 'systemManagement',
meta: {
title: '系统管理',
icon: 'Setting',

View File

@ -7,7 +7,7 @@ const tableRouter = [{
path: '/table',
component: Layout,
redirect: '/table/comprehensive',
name: 'table',
name: 'superTable',
meta: {
title: '超级表格',
icon: 'School'

View File

@ -7,5 +7,5 @@ export function generateTitle(route) {
const translatedTitle = I18n.global.t('route.' + route.name)
return translatedTitle
}
return route.meta.title
return route?.meta?.title
}