From dd18f51afeef50baf8551466af512eae9c5c319e Mon Sep 17 00:00:00 2001 From: Pan Date: Tue, 2 Apr 2019 16:56:52 +0800 Subject: [PATCH 01/29] rm --- src/components/Breadcrumb/index.vue | 7 +--- src/components/HeaderSearch/index.vue | 6 +-- src/components/LangSelect/index.vue | 38 ------------------- src/layout/components/Sidebar/SidebarItem.vue | 9 ++--- src/layout/components/TagsView/index.vue | 4 +- src/views/login/index.vue | 4 +- 6 files changed, 8 insertions(+), 60 deletions(-) delete mode 100644 src/components/LangSelect/index.vue diff --git a/src/components/Breadcrumb/index.vue b/src/components/Breadcrumb/index.vue index ff93ff45771..582449b6dc8 100644 --- a/src/components/Breadcrumb/index.vue +++ b/src/components/Breadcrumb/index.vue @@ -2,16 +2,14 @@ - {{ - generateTitle(item.meta.title) }} - {{ generateTitle(item.meta.title) }} + {{ item.meta.title }} + {{ item.meta.title }} diff --git a/src/layout/components/Sidebar/SidebarItem.vue b/src/layout/components/Sidebar/SidebarItem.vue index 8c9c4328317..88f72908a69 100644 --- a/src/layout/components/Sidebar/SidebarItem.vue +++ b/src/layout/components/Sidebar/SidebarItem.vue @@ -3,14 +3,14 @@ import path from 'path' -import { generateTitle } from '@/utils/i18n' import { isExternal } from '@/utils/validate' import Item from './Item' import AppLink from './Link' @@ -87,9 +86,7 @@ export default { return routePath } return path.resolve(this.basePath, routePath) - }, - - generateTitle + } } } diff --git a/src/layout/components/TagsView/index.vue b/src/layout/components/TagsView/index.vue index bdddaba63b5..769e6fc8dad 100644 --- a/src/layout/components/TagsView/index.vue +++ b/src/layout/components/TagsView/index.vue @@ -12,7 +12,7 @@ @click.middle.native="closeSelectedTag(tag)" @contextmenu.prevent.native="openMenu(tag,$event)" > - {{ generateTitle(tag.title) }} + {{ tag.title }} @@ -36,7 +36,6 @@ - - diff --git a/src/views/i18n-demo/local.js b/src/views/i18n-demo/local.js deleted file mode 100644 index 9b43e60533b..00000000000 --- a/src/views/i18n-demo/local.js +++ /dev/null @@ -1,63 +0,0 @@ - -export default { - zh: { - i18nView: { - title: '切换语言', - note: '本项目国际化基于 vue-i18n', - datePlaceholder: '请选择日期', - selectPlaceholder: '请选择', - tableDate: '日期', - tableName: '姓名', - tableAddress: '地址', - default: '默认按钮', - primary: '主要按钮', - success: '成功按钮', - info: '信息按钮', - warning: '警告按钮', - danger: '危险按钮', - one: '一', - two: '二', - three: '三' - } - }, - en: { - i18nView: { - title: 'Switch Language', - note: 'The internationalization of this project is based on vue-i18n', - datePlaceholder: 'Pick a day', - selectPlaceholder: 'Select', - tableDate: 'tableDate', - tableName: 'tableName', - tableAddress: 'tableAddress', - default: 'default:', - primary: 'primary', - success: 'success', - info: 'info', - warning: 'warning', - danger: 'danger', - one: 'One', - two: 'Two', - three: 'Three' - } - }, - es: { - i18nView: { - title: 'Switch Language', - note: 'The internationalization of this project is based on vue-i18n', - datePlaceholder: 'Pick a day', - selectPlaceholder: 'Select', - tableDate: 'tableDate', - tableName: 'tableName', - tableAddress: 'tableAddress', - default: 'default:', - primary: 'primary', - success: 'success', - info: 'info', - warning: 'warning', - danger: 'danger', - one: 'One', - two: 'Two', - three: 'Three' - } - } -} From 7157c2a72891e53aaca6bc99093b4bd577aed8f7 Mon Sep 17 00:00:00 2001 From: Pan Date: Tue, 2 Apr 2019 17:35:39 +0800 Subject: [PATCH 03/29] refine --- src/layout/components/Navbar.vue | 16 +++------- src/views/documentation/index.vue | 19 ++++++++++-- src/views/guide/index.vue | 5 ++-- src/views/login/index.vue | 28 +++++++---------- .../permission/components/SwitchRoles.vue | 4 +-- src/views/permission/directive.vue | 2 +- src/views/permission/role.vue | 30 +++++++++---------- 7 files changed, 51 insertions(+), 53 deletions(-) diff --git a/src/layout/components/Navbar.vue b/src/layout/components/Navbar.vue index b0ee54c1bd7..606d2b07a33 100644 --- a/src/layout/components/Navbar.vue +++ b/src/layout/components/Navbar.vue @@ -12,12 +12,10 @@ - + - - @@ -27,17 +25,13 @@ - - {{ $t('navbar.dashboard') }} - + Dashboard - - {{ $t('navbar.github') }} - + Github - {{ $t('navbar.logOut') }} + Log Out @@ -52,7 +46,6 @@ import Hamburger from '@/components/Hamburger' import ErrorLog from '@/components/ErrorLog' import Screenfull from '@/components/Screenfull' import SizeSelect from '@/components/SizeSelect' -import LangSelect from '@/components/LangSelect' import Search from '@/components/HeaderSearch' export default { @@ -62,7 +55,6 @@ export default { ErrorLog, Screenfull, SizeSelect, - LangSelect, Search }, computed: { diff --git a/src/views/documentation/index.vue b/src/views/documentation/index.vue index 2fed7398f91..e1133d32770 100644 --- a/src/views/documentation/index.vue +++ b/src/views/documentation/index.vue @@ -1,11 +1,24 @@ + + + From d025ea74c96ad66ebd9d971d9efc59c84d5078b0 Mon Sep 17 00:00:00 2001 From: Pan Date: Tue, 16 Apr 2019 11:48:31 +0800 Subject: [PATCH 15/29] refine --- src/utils/get-page-title.js | 9 +++------ src/views/example/components/ArticleDetail.vue | 1 + src/views/example/components/Warning.vue | 6 ++++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/utils/get-page-title.js b/src/utils/get-page-title.js index 4b6604cdea8..cab7fd912b1 100644 --- a/src/utils/get-page-title.js +++ b/src/utils/get-page-title.js @@ -1,13 +1,10 @@ import defaultSettings from '@/settings' -import i18n from '@/lang' const title = defaultSettings.title || 'Vue Element Admin' -export default function getPageTitle(key) { - const hasKey = i18n.te(`route.${key}`) - if (hasKey) { - const pageName = i18n.t(`route.${key}`) - return `${pageName} - ${title}` +export default function getPageTitle(pageTitle) { + if (pageTitle) { + return `${pageTitle} - ${title}` } return `${title}` } diff --git a/src/views/example/components/ArticleDetail.vue b/src/views/example/components/ArticleDetail.vue index b1aa8df6b74..734209b38d7 100644 --- a/src/views/example/components/ArticleDetail.vue +++ b/src/views/example/components/ArticleDetail.vue @@ -1,6 +1,7 @@