Skip to content

Commit bcdca55

Browse files
committed
feat: 汉化 & warning fix
1 parent f84d5be commit bcdca55

File tree

14 files changed

+106
-129
lines changed

14 files changed

+106
-129
lines changed

components.d.ts

+15
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,19 @@ declare module 'vue' {
1313
DropdownMenu: typeof import('./src/components/Share/DropdownMenu.vue')['default']
1414
Dropzone: typeof import('./src/components/Dropzone/index.vue')['default']
1515
EditorImage: typeof import('./src/components/Tinymce/components/EditorImage.vue')['default']
16+
ElAlert: typeof import('element-plus/es')['ElAlert']
1617
ElBadge: typeof import('element-plus/es')['ElBadge']
1718
ElBreadcrumb: typeof import('element-plus/es')['ElBreadcrumb']
1819
ElBreadcrumbItem: typeof import('element-plus/es')['ElBreadcrumbItem']
1920
ElButton: typeof import('element-plus/es')['ElButton']
2021
ElCard: typeof import('element-plus/es')['ElCard']
22+
ElCarousel: typeof import('element-plus/es')['ElCarousel']
23+
ElCarouselItem: typeof import('element-plus/es')['ElCarouselItem']
24+
ElCheckbox: typeof import('element-plus/es')['ElCheckbox']
25+
ElCheckboxGroup: typeof import('element-plus/es')['ElCheckboxGroup']
2126
ElCol: typeof import('element-plus/es')['ElCol']
2227
ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider']
28+
ElDatePicker: typeof import('element-plus/es')['ElDatePicker']
2329
ElDialog: typeof import('element-plus/es')['ElDialog']
2430
ElDropdown: typeof import('element-plus/es')['ElDropdown']
2531
ElDropdownItem: typeof import('element-plus/es')['ElDropdownItem']
@@ -31,19 +37,25 @@ declare module 'vue' {
3137
ElMenu: typeof import('element-plus/es')['ElMenu']
3238
ElMenuItem: typeof import('element-plus/es')['ElMenuItem']
3339
ElOption: typeof import('element-plus/es')['ElOption']
40+
ElPagination: typeof import('element-plus/es')['ElPagination']
3441
ElProgress: typeof import('element-plus/es')['ElProgress']
42+
ElRadio: typeof import('element-plus/es')['ElRadio']
3543
ElRadioButton: typeof import('element-plus/es')['ElRadioButton']
3644
ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup']
45+
ElRate: typeof import('element-plus/es')['ElRate']
3746
ElRow: typeof import('element-plus/es')['ElRow']
3847
ElScrollbar: typeof import('element-plus/es')['ElScrollbar']
3948
ElSelect: typeof import('element-plus/es')['ElSelect']
49+
ElSlider: typeof import('element-plus/es')['ElSlider']
4050
ElSubMenu: typeof import('element-plus/es')['ElSubMenu']
4151
ElSwitch: typeof import('element-plus/es')['ElSwitch']
4252
ElTable: typeof import('element-plus/es')['ElTable']
4353
ElTableColumn: typeof import('element-plus/es')['ElTableColumn']
4454
ElTabPane: typeof import('element-plus/es')['ElTabPane']
4555
ElTabs: typeof import('element-plus/es')['ElTabs']
4656
ElTag: typeof import('element-plus/es')['ElTag']
57+
ElTimeline: typeof import('element-plus/es')['ElTimeline']
58+
ElTimelineItem: typeof import('element-plus/es')['ElTimelineItem']
4759
ElTooltip: typeof import('element-plus/es')['ElTooltip']
4860
ElTree: typeof import('element-plus/es')['ElTree']
4961
ElUpload: typeof import('element-plus/es')['ElUpload']
@@ -73,4 +85,7 @@ declare module 'vue' {
7385
UploadExcel: typeof import('./src/components/UploadExcel/index.vue')['default']
7486
VueCountTo: typeof import('./src/components/vue-count-to/vue-countTo.vue')['default']
7587
}
88+
export interface ComponentCustomProperties {
89+
vLoading: typeof import('element-plus/es')['ElLoadingDirective']
90+
}
7691
}

src/components/DragSelect/index.vue

+9-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,14 @@ export default defineComponent({
1414
modelValue: {
1515
type: Array,
1616
required: true
17+
},
18+
placeholder: {
19+
type: String,
20+
default: null
21+
},
22+
style: {
23+
type: [String, Object],
24+
default: null
1725
}
1826
},
1927
computed: {
@@ -31,7 +39,7 @@ export default defineComponent({
3139
},
3240
methods: {
3341
setSort() {
34-
const el = this.$refs.dragSelect.$el.querySelectorAll('.el-select__tags > span')[0];
42+
const el = this.$refs.dragSelect.$el.querySelector('.el-select__wrapper .el-select__selection');
3543
this.sortable = Sortable.create(el, {
3644
ghostClass: 'sortable-ghost', // Class name for the drop placeholder,
3745
setData: function(dataTransfer) {

src/layout/components/Navbar.vue

+5-5
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,19 @@
2929
<template #dropdown>
3030
<el-dropdown-menu>
3131
<router-link to="/profile/index">
32-
<el-dropdown-item>Profile</el-dropdown-item>
32+
<el-dropdown-item>个人中心</el-dropdown-item>
3333
</router-link>
3434
<router-link to="/">
35-
<el-dropdown-item>Dashboard</el-dropdown-item>
35+
<el-dropdown-item>首页</el-dropdown-item>
3636
</router-link>
3737
<a target="_blank" href="https://github.com/midfar/vue3-element-admin">
38-
<el-dropdown-item>Github</el-dropdown-item>
38+
<el-dropdown-item>项目地址</el-dropdown-item>
3939
</a>
4040
<a target="_blank" href="https://vue3-element-admin-site.midfar.com/">
41-
<el-dropdown-item>Docs</el-dropdown-item>
41+
<el-dropdown-item>文档地址</el-dropdown-item>
4242
</a>
4343
<el-dropdown-item divided @click="logout">
44-
<span style="display:block;">Log Out</span>
44+
<span style="display:block;">退出登录</span>
4545
</el-dropdown-item>
4646
</el-dropdown-menu>
4747
</template>

src/layout/components/Settings/index.vue

+8-5
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
11
<template>
22
<div class="drawer-container">
33
<div>
4-
<h3 class="drawer-title">Page style setting</h3>
4+
<h3 class="drawer-title">系统设置</h3>
55

66
<!-- <div class="drawer-item">
77
<span>Theme Color</span>
88
<theme-picker style="float: right;height: 26px;margin: -3px 8px 0 0;" @change="themeChange" />
99
</div> -->
1010

1111
<div class="drawer-item">
12-
<span>Open Tags-View</span>
12+
<span>开启 Tags-View</span>
1313
<el-switch v-model="tagsView" class="drawer-switch" />
1414
</div>
1515

1616
<div class="drawer-item">
17-
<span>Fixed Header</span>
17+
<span>固定 Header</span>
1818
<el-switch v-model="fixedHeader" class="drawer-switch" />
1919
</div>
2020

2121
<div class="drawer-item">
22-
<span>Sidebar Logo</span>
22+
<span>侧边栏 Logo</span>
2323
<el-switch v-model="sidebarLogo" class="drawer-switch" />
2424
</div>
2525

2626
<div class="drawer-item">
27-
<span>左侧菜单子目录气泡显示</span>
27+
<span>侧边栏子目录气泡显示</span>
2828
<el-switch v-model="secondMenuPopup" class="drawer-switch" />
2929
</div>
3030

@@ -116,6 +116,9 @@ export default defineComponent({
116116
}
117117
118118
.drawer-item {
119+
display: flex;
120+
align-items: center;
121+
justify-content: space-between;
119122
color: rgba(0, 0, 0, .65);
120123
font-size: 14px;
121124
padding: 12px 0;

src/permission.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ NProgress.configure({ showSpinner: false }); // NProgress Configuration
1111
const whiteList = ['/login', '/auth-redirect']; // no redirect whitelist
1212

1313
router.beforeEach(async (to, from, next) => {
14-
console.log('router.beforeEach', to.path, from.path);
14+
// console.log('router.beforeEach', to.path, from.path);
1515
// start progress bar
1616
NProgress.start();
1717

src/router/index.ts

+27-27
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export const constantRoutes:RouteRecordRaw[] = [
6060
path: 'dashboard',
6161
component: () => import('@/views/dashboard/index.vue'),
6262
name: 'Dashboard',
63-
meta: { title: 'Dashboard', icon: 'dashboard', affix: true }
63+
meta: { title: '首页', icon: 'dashboard', affix: true }
6464
}
6565
]
6666
},
@@ -72,7 +72,7 @@ export const constantRoutes:RouteRecordRaw[] = [
7272
path: 'index',
7373
component: () => import('@/views/documentation/index.vue'),
7474
name: 'Documentation',
75-
meta: { title: 'Documentation', icon: 'documentation', affix: true }
75+
meta: { title: '文档', icon: 'documentation', affix: true }
7676
}
7777
]
7878
},
@@ -85,7 +85,7 @@ export const constantRoutes:RouteRecordRaw[] = [
8585
path: 'index',
8686
component: () => import('@/views/guide/index.vue'),
8787
name: 'Guide',
88-
meta: { title: 'Guide', icon: 'guide', noCache: true }
88+
meta: { title: '引导页', icon: 'guide', noCache: true }
8989
}
9090
]
9191
},
@@ -99,7 +99,7 @@ export const constantRoutes:RouteRecordRaw[] = [
9999
path: 'index',
100100
component: () => import('@/views/profile/index.vue'),
101101
name: 'Profile',
102-
meta: { title: 'Profile', icon: 'user', noCache: true }
102+
meta: { title: '个人中心', icon: 'user', noCache: true }
103103
}
104104
]
105105
}
@@ -119,7 +119,7 @@ export const asyncRoutes:RouteRecordRaw[] = [
119119
name: 'Permission',
120120
meta: {
121121
alwaysShow: true, // will always show the root menu
122-
title: 'Permission',
122+
title: '权限测试页',
123123
icon: 'lock',
124124
roles: ['admin', 'editor'] // you can set roles in root nav
125125
},
@@ -129,7 +129,7 @@ export const asyncRoutes:RouteRecordRaw[] = [
129129
component: () => import('@/views/permission/page.vue'),
130130
name: 'PagePermission',
131131
meta: {
132-
title: 'Page Permission',
132+
title: '页面权限',
133133
roles: ['admin'] // or you can only set roles in sub nav
134134
}
135135
},
@@ -138,7 +138,7 @@ export const asyncRoutes:RouteRecordRaw[] = [
138138
component: () => import('@/views/permission/directive.vue'),
139139
name: 'DirectivePermission',
140140
meta: {
141-
title: 'Directive Permission'
141+
title: '指令权限'
142142
// if do not set roles, means: this page does not require permission
143143
}
144144
},
@@ -147,7 +147,7 @@ export const asyncRoutes:RouteRecordRaw[] = [
147147
component: () => import('@/views/permission/role.vue'),
148148
name: 'RolePermission',
149149
meta: {
150-
title: 'Role Permission',
150+
title: '角色权限',
151151
roles: ['admin']
152152
}
153153
}
@@ -162,7 +162,7 @@ export const asyncRoutes:RouteRecordRaw[] = [
162162
path: 'index',
163163
component: () => import('@/views/icons/index.vue'),
164164
name: 'Icons',
165-
meta: { title: 'Icons', icon: 'icon', noCache: true }
165+
meta: { title: '图标', icon: 'icon', noCache: true }
166166
}
167167
]
168168
},
@@ -179,27 +179,27 @@ export const asyncRoutes:RouteRecordRaw[] = [
179179
redirect: '/example/list',
180180
name: 'Example',
181181
meta: {
182-
title: 'Example',
182+
title: '综合示例',
183183
icon: markRaw(IconHelp)
184184
},
185185
children: [
186186
{
187187
path: 'create',
188188
component: () => import('@/views/example/create.vue'),
189189
name: 'CreateArticle',
190-
meta: { title: 'Create Article', icon: 'edit' }
190+
meta: { title: '创建文章', icon: 'edit' }
191191
},
192192
{
193193
path: 'edit/:id(\\d+)',
194194
component: () => import('@/views/example/edit.vue'),
195195
name: 'EditArticle',
196-
meta: { hidden: true, title: 'Edit Article', noCache: true, activeMenu: '/example/list' }
196+
meta: { hidden: true, title: '编辑文章', noCache: true, activeMenu: '/example/list' }
197197
},
198198
{
199199
path: 'list',
200200
component: () => import('@/views/example/list.vue'),
201201
name: 'ArticleList',
202-
meta: { title: 'Article List', icon: 'list' }
202+
meta: { title: '文章列表', icon: 'list' }
203203
}
204204
]
205205
},
@@ -212,7 +212,7 @@ export const asyncRoutes:RouteRecordRaw[] = [
212212
path: 'index',
213213
component: () => import('@/views/tab/index.vue'),
214214
name: 'Tab',
215-
meta: { title: 'Tab', icon: 'tab' }
215+
meta: { title: 'Tabs标签页', icon: 'tab' }
216216
}
217217
]
218218
},
@@ -223,7 +223,7 @@ export const asyncRoutes:RouteRecordRaw[] = [
223223
redirect: 'noRedirect',
224224
name: 'ErrorPages',
225225
meta: {
226-
title: 'Error Pages',
226+
title: '错误页面',
227227
icon: '404'
228228
},
229229
children: [
@@ -250,7 +250,7 @@ export const asyncRoutes:RouteRecordRaw[] = [
250250
path: 'log',
251251
component: () => import('@/views/error-log/index.vue'),
252252
name: 'ErrorLog',
253-
meta: { title: 'Error Log', icon: 'bug' }
253+
meta: { title: '错误日志', icon: 'bug' }
254254
}
255255
]
256256
},
@@ -269,25 +269,25 @@ export const asyncRoutes:RouteRecordRaw[] = [
269269
path: 'export-excel',
270270
component: () => import('@/views/excel/export-excel.vue'),
271271
name: 'ExportExcel',
272-
meta: { title: 'Export Excel' }
272+
meta: { title: '导出 Excel' }
273273
},
274274
{
275275
path: 'export-selected-excel',
276276
component: () => import('@/views/excel/select-excel.vue'),
277277
name: 'SelectExcel',
278-
meta: { title: 'Export Selected' }
278+
meta: { title: '导出 已选择项' }
279279
},
280280
{
281281
path: 'export-merge-header',
282282
component: () => import('@/views/excel/merge-header.vue'),
283283
name: 'MergeHeader',
284-
meta: { title: 'Merge Header' }
284+
meta: { title: '导出 多级表头' }
285285
},
286286
{
287287
path: 'upload-excel',
288288
component: () => import('@/views/excel/upload-excel.vue'),
289289
name: 'UploadExcel',
290-
meta: { title: 'Upload Excel' }
290+
meta: { title: '上传 Excel' }
291291
}
292292
]
293293
},
@@ -303,7 +303,7 @@ export const asyncRoutes:RouteRecordRaw[] = [
303303
path: 'download',
304304
component: () => import('@/views/zip/index.vue'),
305305
name: 'ExportZip',
306-
meta: { title: 'Export Zip' }
306+
meta: { title: '导出 Zip' }
307307
}
308308
]
309309
},
@@ -335,7 +335,7 @@ export const asyncRoutes:RouteRecordRaw[] = [
335335
path: 'index',
336336
component: () => import('@/views/theme/index.vue'),
337337
name: 'Theme',
338-
meta: { title: 'Theme', icon: 'theme' }
338+
meta: { title: '主题', icon: 'theme' }
339339
}
340340
]
341341
},
@@ -348,7 +348,7 @@ export const asyncRoutes:RouteRecordRaw[] = [
348348
path: 'index',
349349
component: () => import('@/views/clipboard/index.vue'),
350350
name: 'ClipboardDemo',
351-
meta: { title: 'Clipboard', icon: 'clipboard' }
351+
meta: { title: '剪贴板', icon: 'clipboard' }
352352
}
353353
]
354354
},
@@ -359,7 +359,7 @@ export const asyncRoutes:RouteRecordRaw[] = [
359359
children: [
360360
{
361361
path: 'https://element-plus.midfar.com',
362-
meta: { title: 'External Link', icon: 'link' },
362+
meta: { title: '外链', icon: 'link' },
363363
redirect: ''
364364
}
365365
]
@@ -370,21 +370,21 @@ export const asyncRoutes:RouteRecordRaw[] = [
370370
component: Layout,
371371
name: 'MyDemo',
372372
meta: {
373-
title: 'MyDemo',
373+
title: '我的示例',
374374
icon: 'component'
375375
},
376376
children: [
377377
{
378378
path: 'element-demo',
379379
component: () => import('@/views/mydemo/ElementDemo.vue'),
380380
name: 'ElementDemo',
381-
meta: { title: 'ElementDemo', icon: 'skill' }
381+
meta: { title: 'Element 示例', icon: 'skill' }
382382
},
383383
{
384384
path: 'store-demo',
385385
component: () => import('@/views/mydemo/StoreDemo.vue'),
386386
name: 'StoreDemo',
387-
meta: { title: 'StoreDemo', icon: 'lock' }
387+
meta: { title: 'Store 示例', icon: 'lock' }
388388
}
389389
]
390390
},

0 commit comments

Comments
 (0)