From cde663ab152c016058784d6c783d91de882869a1 Mon Sep 17 00:00:00 2001 From: Tuan Duong Date: Mon, 22 Apr 2019 22:56:22 +0700 Subject: [PATCH] Implement mockup for profile page --- src/filters/index.js | 8 + src/icons/svg/education.svg | 1 + src/icons/svg/skill.svg | 1 + src/lang/en.js | 6 +- src/lang/zh.js | 6 +- src/layout/components/Navbar.vue | 5 + src/router/index.js | 14 ++ src/views/profile/index.vue | 389 +++++++++++++++++++++++++++++++ 8 files changed, 426 insertions(+), 4 deletions(-) create mode 100644 src/icons/svg/education.svg create mode 100644 src/icons/svg/skill.svg create mode 100644 src/views/profile/index.vue diff --git a/src/filters/index.js b/src/filters/index.js index 051000c1..f6a28488 100644 --- a/src/filters/index.js +++ b/src/filters/index.js @@ -58,3 +58,11 @@ export function numberFormatter(num, digits) { export function toThousandFilter(num) { return (+num || 0).toString().replace(/^-?\d+/g, m => m.replace(/(?=(?!\b)(\d{3})+$)/g, ',')) } + +/** + * Upper case first char + * @param {String} string + */ +export function uppercaseFirst(string) { + return string.charAt(0).toUpperCase() + string.slice(1) +} diff --git a/src/icons/svg/education.svg b/src/icons/svg/education.svg new file mode 100644 index 00000000..db70f234 --- /dev/null +++ b/src/icons/svg/education.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/skill.svg b/src/icons/svg/skill.svg new file mode 100644 index 00000000..7ff3daa7 --- /dev/null +++ b/src/icons/svg/skill.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/lang/en.js b/src/lang/en.js index 426d3d26..ae221ba8 100644 --- a/src/lang/en.js +++ b/src/lang/en.js @@ -61,12 +61,14 @@ export default { theme: 'Theme', clipboardDemo: 'Clipboard', i18n: 'I18n', - externalLink: 'External Link' + externalLink: 'External Link', + profile: 'Profile' }, navbar: { - logOut: 'Log Out', dashboard: 'Dashboard', github: 'Github', + logOut: 'Log Out', + profile: 'Profile', theme: 'Theme', size: 'Global Size' }, diff --git a/src/lang/zh.js b/src/lang/zh.js index 2055c5ab..d637b3b3 100644 --- a/src/lang/zh.js +++ b/src/lang/zh.js @@ -61,12 +61,14 @@ export default { theme: '换肤', clipboardDemo: 'Clipboard', i18n: '国际化', - externalLink: '外链' + externalLink: '外链', + profile: '个人资料页' }, navbar: { - logOut: '退出登录', dashboard: '首页', github: '项目地址', + logOut: '退出登录', + profile: '个人资料页', theme: '换肤', size: '布局大小' }, diff --git a/src/layout/components/Navbar.vue b/src/layout/components/Navbar.vue index 51972166..6cf2b701 100644 --- a/src/layout/components/Navbar.vue +++ b/src/layout/components/Navbar.vue @@ -26,6 +26,11 @@ + + + {{ $t('navbar.profile') }} + + {{ $t('navbar.dashboard') }} diff --git a/src/router/index.js b/src/router/index.js index 34afd5c5..d1dfda90 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -107,6 +107,20 @@ export const constantRoutes = [ meta: { title: 'guide', icon: 'guide', noCache: true } } ] + }, + { + path: '/profile', + component: Layout, + redirect: '/profile/index', + hidden: true, + children: [ + { + path: 'index', + component: () => import('@/views/profile/index'), + name: 'Profile', + meta: { title: 'profile', icon: 'user', noCache: true } + } + ] } ] diff --git a/src/views/profile/index.vue b/src/views/profile/index.vue new file mode 100644 index 00000000..663f4dda --- /dev/null +++ b/src/views/profile/index.vue @@ -0,0 +1,389 @@ + + + + +