From 00d292f67e93cb4a7c6a97c9604de571b556ad2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8A=B1=E8=A3=A4=E8=A1=A9?= Date: Fri, 24 Aug 2018 10:06:09 +0800 Subject: [PATCH] feature: [sidebar] add external-link (#991) --- src/icons/svg/link.svg | 1 + src/lang/en.js | 3 +- src/lang/zh.js | 3 +- src/router/index.js | 11 ++++++ src/views/layout/components/Sidebar/Item.vue | 29 +++++++++++++++ .../layout/components/Sidebar/SidebarItem.vue | 36 ++++++++++++------- 6 files changed, 68 insertions(+), 15 deletions(-) create mode 100644 src/icons/svg/link.svg create mode 100644 src/views/layout/components/Sidebar/Item.vue diff --git a/src/icons/svg/link.svg b/src/icons/svg/link.svg new file mode 100644 index 00000000..11037e6f --- /dev/null +++ b/src/icons/svg/link.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/lang/en.js b/src/lang/en.js index d47b557f..52fe707d 100644 --- a/src/lang/en.js +++ b/src/lang/en.js @@ -60,7 +60,8 @@ export default { exportZip: 'Export Zip', theme: 'Theme', clipboardDemo: 'Clipboard', - i18n: 'I18n' + i18n: 'I18n', + externalLink: 'External Link' }, navbar: { logOut: 'Log Out', diff --git a/src/lang/zh.js b/src/lang/zh.js index 7958b879..ee182ec4 100644 --- a/src/lang/zh.js +++ b/src/lang/zh.js @@ -60,7 +60,8 @@ export default { exportZip: 'Export Zip', theme: '换肤', clipboardDemo: 'Clipboard', - i18n: '国际化' + i18n: '国际化', + externalLink: '外链' }, navbar: { logOut: '退出登录', diff --git a/src/router/index.js b/src/router/index.js index 76a517c8..6c0c0f0d 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -322,5 +322,16 @@ export const asyncRouterMap = [ ] }, + { + path: 'external-link', + component: Layout, + children: [ + { + path: 'https://github.com/PanJiaChen/vue-element-admin', + meta: { title: 'externalLink', icon: 'link' } + } + ] + }, + { path: '*', redirect: '/404', hidden: true } ] diff --git a/src/views/layout/components/Sidebar/Item.vue b/src/views/layout/components/Sidebar/Item.vue new file mode 100644 index 00000000..b515f615 --- /dev/null +++ b/src/views/layout/components/Sidebar/Item.vue @@ -0,0 +1,29 @@ + diff --git a/src/views/layout/components/Sidebar/SidebarItem.vue b/src/views/layout/components/Sidebar/SidebarItem.vue index 30a22baf..1a1d9514 100644 --- a/src/views/layout/components/Sidebar/SidebarItem.vue +++ b/src/views/layout/components/Sidebar/SidebarItem.vue @@ -1,17 +1,23 @@