Skip to content

feat: 将菜单标题改为中文 #4311

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# 使用官方 nginx 镜像作为基础镜像
FROM nginx:1.24-alpine

# 维护者信息
LABEL maintainer="yubin"

# 删除默认 nginx 静态资源
RUN rm -rf /usr/share/nginx/html/*

# 拷贝前端打包后的文件到 nginx 目录
COPY dist/ /usr/share/nginx/html/

# 拷贝自定义 nginx 配置(可选)
# COPY nginx.conf /etc/nginx/nginx.conf

# 暴露端口
EXPOSE 80

# 启动 nginx
CMD ["nginx", "-g", "daemon off;"]
4 changes: 1 addition & 3 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down
48 changes: 24 additions & 24 deletions src/router/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
}
]
},
Expand All @@ -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 }
}
]
},
Expand All @@ -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 }
}
]
},
Expand All @@ -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 }
}
]
}
Expand All @@ -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
},
Expand All @@ -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
}
},
Expand All @@ -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
}
},
Expand All @@ -164,7 +164,7 @@ export const asyncRoutes = [
component: () => import('@/views/permission/role'),
name: 'RolePermission',
meta: {
title: 'Role Permission',
title: '角色权限',
roles: ['admin']
}
}
Expand All @@ -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 }
}
]
},
Expand All @@ -196,28 +196,28 @@ export const asyncRoutes = [
redirect: '/example/list',
name: 'Example',
meta: {
title: 'Example',
title: '示例',
icon: 'el-icon-s-help'
},
children: [
{
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' }
}
]
},
Expand All @@ -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' }
}
]
},
Expand All @@ -241,7 +241,7 @@ export const asyncRoutes = [
redirect: 'noRedirect',
name: 'ErrorPages',
meta: {
title: 'Error Pages',
title: '错误页面',
icon: '404'
},
children: [
Expand All @@ -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' }
}
]
},
Expand All @@ -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' }
}
]
},
Expand All @@ -322,7 +322,7 @@ export const asyncRoutes = [
path: 'download',
component: () => import('@/views/zip/index'),
name: 'ExportZip',
meta: { title: 'Export Zip' }
meta: { title: '导出 Zip' }
}
]
},
Expand Down Expand Up @@ -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' }
}
]
},
Expand All @@ -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' }
}
]
},
Expand All @@ -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' }
}
]
},
Expand Down
8 changes: 4 additions & 4 deletions src/router/modules/charts.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,27 @@ const chartsRouter = {
redirect: 'noRedirect',
name: 'Charts',
meta: {
title: 'Charts',
title: '图表',
icon: 'chart'
},
children: [
{
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 }
}
]
}
Expand Down
30 changes: 15 additions & 15 deletions src/router/modules/components.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,93 +8,93 @@ const componentsRouter = {
redirect: 'noRedirect',
name: 'ComponentDemo',
meta: {
title: 'Components',
title: '组件',
icon: 'component'
},
children: [
{
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: '拖拽看板' }
}
]
}
Expand Down
Loading