1
0
mirror of https://github.com/PanJiaChen/vue-element-admin.git synced 2025-05-20 16:19:17 +08:00

feat: 将菜单标题改为中文

This commit is contained in:
yubin 2025-04-28 16:58:43 +08:00
parent 6858a9ad67
commit 8b83ff1122
6 changed files with 57 additions and 59 deletions

View File

@ -6,7 +6,6 @@ import 'normalize.css/normalize.css' // a modern alternative to CSS resets
import Element from 'element-ui'
import './styles/element-variables.scss'
import enLang from 'element-ui/lib/locale/lang/en'// 如果使用中文语言包请默认支持,无需额外引入,请删除该依赖
import '@/styles/index.scss' // global css
@ -34,8 +33,7 @@ if (process.env.NODE_ENV === 'production') {
}
Vue.use(Element, {
size: Cookies.get('size') || 'medium', // set element-ui default size
locale: enLang // 如果使用中文,无需设置,请删除
size: Cookies.get('size') || 'medium' // set element-ui default size
})
// register global utility filters

View File

@ -79,7 +79,7 @@ export const constantRoutes = [
path: 'dashboard',
component: () => import('@/views/dashboard/index'),
name: 'Dashboard',
meta: { title: 'Dashboard', icon: 'dashboard', affix: true }
meta: { title: '仪表盘', icon: 'dashboard', affix: true }
}
]
},
@ -91,7 +91,7 @@ export const constantRoutes = [
path: 'index',
component: () => import('@/views/documentation/index'),
name: 'Documentation',
meta: { title: 'Documentation', icon: 'documentation', affix: true }
meta: { title: '文档', icon: 'documentation', affix: true }
}
]
},
@ -104,7 +104,7 @@ export const constantRoutes = [
path: 'index',
component: () => import('@/views/guide/index'),
name: 'Guide',
meta: { title: 'Guide', icon: 'guide', noCache: true }
meta: { title: '引导页', icon: 'guide', noCache: true }
}
]
},
@ -118,7 +118,7 @@ export const constantRoutes = [
path: 'index',
component: () => import('@/views/profile/index'),
name: 'Profile',
meta: { title: 'Profile', icon: 'user', noCache: true }
meta: { title: '个人中心', icon: 'user', noCache: true }
}
]
}
@ -136,7 +136,7 @@ export const asyncRoutes = [
alwaysShow: true, // will always show the root menu
name: 'Permission',
meta: {
title: 'Permission',
title: '权限',
icon: 'lock',
roles: ['admin', 'editor'] // you can set roles in root nav
},
@ -146,7 +146,7 @@ export const asyncRoutes = [
component: () => import('@/views/permission/page'),
name: 'PagePermission',
meta: {
title: 'Page Permission',
title: '页面权限',
roles: ['admin'] // or you can only set roles in sub nav
}
},
@ -155,7 +155,7 @@ export const asyncRoutes = [
component: () => import('@/views/permission/directive'),
name: 'DirectivePermission',
meta: {
title: 'Directive Permission'
title: '指令权限'
// if do not set roles, means: this page does not require permission
}
},
@ -164,7 +164,7 @@ export const asyncRoutes = [
component: () => import('@/views/permission/role'),
name: 'RolePermission',
meta: {
title: 'Role Permission',
title: '角色权限',
roles: ['admin']
}
}
@ -179,7 +179,7 @@ export const asyncRoutes = [
path: 'index',
component: () => import('@/views/icons/index'),
name: 'Icons',
meta: { title: 'Icons', icon: 'icon', noCache: true }
meta: { title: '图标', icon: 'icon', noCache: true }
}
]
},
@ -196,7 +196,7 @@ export const asyncRoutes = [
redirect: '/example/list',
name: 'Example',
meta: {
title: 'Example',
title: '示例',
icon: 'el-icon-s-help'
},
children: [
@ -204,20 +204,20 @@ export const asyncRoutes = [
path: 'create',
component: () => import('@/views/example/create'),
name: 'CreateArticle',
meta: { title: 'Create Article', icon: 'edit' }
meta: { title: '创建文章', icon: 'edit' }
},
{
path: 'edit/:id(\\d+)',
component: () => import('@/views/example/edit'),
name: 'EditArticle',
meta: { title: 'Edit Article', noCache: true, activeMenu: '/example/list' },
meta: { title: '编辑文章', noCache: true, activeMenu: '/example/list' },
hidden: true
},
{
path: 'list',
component: () => import('@/views/example/list'),
name: 'ArticleList',
meta: { title: 'Article List', icon: 'list' }
meta: { title: '文章列表', icon: 'list' }
}
]
},
@ -230,7 +230,7 @@ export const asyncRoutes = [
path: 'index',
component: () => import('@/views/tab/index'),
name: 'Tab',
meta: { title: 'Tab', icon: 'tab' }
meta: { title: '标签页', icon: 'tab' }
}
]
},
@ -241,7 +241,7 @@ export const asyncRoutes = [
redirect: 'noRedirect',
name: 'ErrorPages',
meta: {
title: 'Error Pages',
title: '错误页面',
icon: '404'
},
children: [
@ -268,7 +268,7 @@ export const asyncRoutes = [
path: 'log',
component: () => import('@/views/error-log/index'),
name: 'ErrorLog',
meta: { title: 'Error Log', icon: 'bug' }
meta: { title: '错误日志', icon: 'bug' }
}
]
},
@ -287,25 +287,25 @@ export const asyncRoutes = [
path: 'export-excel',
component: () => import('@/views/excel/export-excel'),
name: 'ExportExcel',
meta: { title: 'Export Excel' }
meta: { title: '导出 Excel' }
},
{
path: 'export-selected-excel',
component: () => import('@/views/excel/select-excel'),
name: 'SelectExcel',
meta: { title: 'Export Selected' }
meta: { title: '导出已选项' }
},
{
path: 'export-merge-header',
component: () => import('@/views/excel/merge-header'),
name: 'MergeHeader',
meta: { title: 'Merge Header' }
meta: { title: '导出多级表头' }
},
{
path: 'upload-excel',
component: () => import('@/views/excel/upload-excel'),
name: 'UploadExcel',
meta: { title: 'Upload Excel' }
meta: { title: '上传 Excel' }
}
]
},
@ -322,7 +322,7 @@ export const asyncRoutes = [
path: 'download',
component: () => import('@/views/zip/index'),
name: 'ExportZip',
meta: { title: 'Export Zip' }
meta: { title: '导出 Zip' }
}
]
},
@ -354,7 +354,7 @@ export const asyncRoutes = [
path: 'index',
component: () => import('@/views/theme/index'),
name: 'Theme',
meta: { title: 'Theme', icon: 'theme' }
meta: { title: '主题', icon: 'theme' }
}
]
},
@ -367,7 +367,7 @@ export const asyncRoutes = [
path: 'index',
component: () => import('@/views/clipboard/index'),
name: 'ClipboardDemo',
meta: { title: 'Clipboard', icon: 'clipboard' }
meta: { title: '剪贴板', icon: 'clipboard' }
}
]
},
@ -378,7 +378,7 @@ export const asyncRoutes = [
children: [
{
path: 'https://github.com/PanJiaChen/vue-element-admin',
meta: { title: 'External Link', icon: 'link' }
meta: { title: '外链', icon: 'link' }
}
]
},

View File

@ -8,7 +8,7 @@ const chartsRouter = {
redirect: 'noRedirect',
name: 'Charts',
meta: {
title: 'Charts',
title: '图表',
icon: 'chart'
},
children: [
@ -16,19 +16,19 @@ const chartsRouter = {
path: 'keyboard',
component: () => import('@/views/charts/keyboard'),
name: 'KeyboardChart',
meta: { title: 'Keyboard Chart', noCache: true }
meta: { title: '键盘图表', noCache: true }
},
{
path: 'line',
component: () => import('@/views/charts/line'),
name: 'LineChart',
meta: { title: 'Line Chart', noCache: true }
meta: { title: '折线图表', noCache: true }
},
{
path: 'mix-chart',
component: () => import('@/views/charts/mix-chart'),
name: 'MixChart',
meta: { title: 'Mix Chart', noCache: true }
meta: { title: '混合图表', noCache: true }
}
]
}

View File

@ -8,7 +8,7 @@ const componentsRouter = {
redirect: 'noRedirect',
name: 'ComponentDemo',
meta: {
title: 'Components',
title: '组件',
icon: 'component'
},
children: [
@ -16,85 +16,85 @@ const componentsRouter = {
path: 'tinymce',
component: () => import('@/views/components-demo/tinymce'),
name: 'TinymceDemo',
meta: { title: 'Tinymce' }
meta: { title: '富文本编辑器' }
},
{
path: 'markdown',
component: () => import('@/views/components-demo/markdown'),
name: 'MarkdownDemo',
meta: { title: 'Markdown' }
meta: { title: 'Markdown编辑器' }
},
{
path: 'json-editor',
component: () => import('@/views/components-demo/json-editor'),
name: 'JsonEditorDemo',
meta: { title: 'JSON Editor' }
meta: { title: 'JSON编辑器' }
},
{
path: 'split-pane',
component: () => import('@/views/components-demo/split-pane'),
name: 'SplitpaneDemo',
meta: { title: 'SplitPane' }
meta: { title: '分割面板' }
},
{
path: 'avatar-upload',
component: () => import('@/views/components-demo/avatar-upload'),
name: 'AvatarUploadDemo',
meta: { title: 'Upload' }
meta: { title: '头像上传' }
},
{
path: 'dropzone',
component: () => import('@/views/components-demo/dropzone'),
name: 'DropzoneDemo',
meta: { title: 'Dropzone' }
meta: { title: '拖拽上传' }
},
{
path: 'sticky',
component: () => import('@/views/components-demo/sticky'),
name: 'StickyDemo',
meta: { title: 'Sticky' }
meta: { title: '粘性布局' }
},
{
path: 'count-to',
component: () => import('@/views/components-demo/count-to'),
name: 'CountToDemo',
meta: { title: 'Count To' }
meta: { title: '数字动画' }
},
{
path: 'mixin',
component: () => import('@/views/components-demo/mixin'),
name: 'ComponentMixinDemo',
meta: { title: 'Component Mixin' }
meta: { title: '组件混入' }
},
{
path: 'back-to-top',
component: () => import('@/views/components-demo/back-to-top'),
name: 'BackToTopDemo',
meta: { title: 'Back To Top' }
meta: { title: '返回顶部' }
},
{
path: 'drag-dialog',
component: () => import('@/views/components-demo/drag-dialog'),
name: 'DragDialogDemo',
meta: { title: 'Drag Dialog' }
meta: { title: '拖拽对话框' }
},
{
path: 'drag-select',
component: () => import('@/views/components-demo/drag-select'),
name: 'DragSelectDemo',
meta: { title: 'Drag Select' }
meta: { title: '拖拽选择' }
},
{
path: 'dnd-list',
component: () => import('@/views/components-demo/dnd-list'),
name: 'DndListDemo',
meta: { title: 'Dnd List' }
meta: { title: '拖拽列表' }
},
{
path: 'drag-kanban',
component: () => import('@/views/components-demo/drag-kanban'),
name: 'DragKanbanDemo',
meta: { title: 'Drag Kanban' }
meta: { title: '拖拽看板' }
}
]
}

View File

@ -8,7 +8,7 @@ const nestedRouter = {
redirect: '/nested/menu1/menu1-1',
name: 'Nested',
meta: {
title: 'Nested Routes',
title: '嵌套路由',
icon: 'nested'
},
children: [
@ -16,33 +16,33 @@ const nestedRouter = {
path: 'menu1',
component: () => import('@/views/nested/menu1/index'), // Parent router-view
name: 'Menu1',
meta: { title: 'Menu 1' },
meta: { title: '菜单1' },
redirect: '/nested/menu1/menu1-1',
children: [
{
path: 'menu1-1',
component: () => import('@/views/nested/menu1/menu1-1'),
name: 'Menu1-1',
meta: { title: 'Menu 1-1' }
meta: { title: '菜单1-1' }
},
{
path: 'menu1-2',
component: () => import('@/views/nested/menu1/menu1-2'),
name: 'Menu1-2',
redirect: '/nested/menu1/menu1-2/menu1-2-1',
meta: { title: 'Menu 1-2' },
meta: { title: '菜单1-2' },
children: [
{
path: 'menu1-2-1',
component: () => import('@/views/nested/menu1/menu1-2/menu1-2-1'),
name: 'Menu1-2-1',
meta: { title: 'Menu 1-2-1' }
meta: { title: '菜单1-2-1' }
},
{
path: 'menu1-2-2',
component: () => import('@/views/nested/menu1/menu1-2/menu1-2-2'),
name: 'Menu1-2-2',
meta: { title: 'Menu 1-2-2' }
meta: { title: '菜单1-2-2' }
}
]
},
@ -50,7 +50,7 @@ const nestedRouter = {
path: 'menu1-3',
component: () => import('@/views/nested/menu1/menu1-3'),
name: 'Menu1-3',
meta: { title: 'Menu 1-3' }
meta: { title: '菜单1-3' }
}
]
},
@ -58,7 +58,7 @@ const nestedRouter = {
path: 'menu2',
name: 'Menu2',
component: () => import('@/views/nested/menu2/index'),
meta: { title: 'Menu 2' }
meta: { title: '菜单2' }
}
]
}

View File

@ -8,7 +8,7 @@ const tableRouter = {
redirect: '/table/complex-table',
name: 'Table',
meta: {
title: 'Table',
title: '表格',
icon: 'table'
},
children: [
@ -16,25 +16,25 @@ const tableRouter = {
path: 'dynamic-table',
component: () => import('@/views/table/dynamic-table/index'),
name: 'DynamicTable',
meta: { title: 'Dynamic Table' }
meta: { title: '动态表格' }
},
{
path: 'drag-table',
component: () => import('@/views/table/drag-table'),
name: 'DragTable',
meta: { title: 'Drag Table' }
meta: { title: '拖拽表格' }
},
{
path: 'inline-edit-table',
component: () => import('@/views/table/inline-edit-table'),
name: 'InlineEditTable',
meta: { title: 'Inline Edit' }
meta: { title: '行内编辑' }
},
{
path: 'complex-table',
component: () => import('@/views/table/complex-table'),
name: 'ComplexTable',
meta: { title: 'Complex Table' }
meta: { title: '综合表格' }
}
]
}