From 189e645b238d73d66cc6ac7adac1d96e3b0d2c97 Mon Sep 17 00:00:00 2001 From: mimimi Date: Wed, 22 Aug 2018 14:42:12 +0800 Subject: [PATCH 1/9] feature[Tinymce]: support i18n (#994) --- src/components/Tinymce/index.vue | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/components/Tinymce/index.vue b/src/components/Tinymce/index.vue index 6383556c..37fd8dd2 100644 --- a/src/components/Tinymce/index.vue +++ b/src/components/Tinymce/index.vue @@ -46,7 +46,16 @@ export default { hasChange: false, hasInit: false, tinymceId: this.id, - fullscreen: false + fullscreen: false, + languageTypeList: { + 'en': 'en', + 'zh': 'zh_CN' + } + } + }, + computed: { + language() { + return this.languageTypeList[this.$store.getters.language] } }, watch: { @@ -55,6 +64,10 @@ export default { this.$nextTick(() => window.tinymce.get(this.tinymceId).setContent(val || '')) } + }, + language() { + this.destroyTinymce() + this.$nextTick(() => this.initTinymce()) } }, mounted() { @@ -73,6 +86,7 @@ export default { initTinymce() { const _this = this window.tinymce.init({ + language: this.language, selector: `#${this.tinymceId}`, height: this.height, body_class: 'panel-body ', From 0e75dcc42a931bca25835941a03572a4ffdc7f83 Mon Sep 17 00:00:00 2001 From: Pan Date: Thu, 23 Aug 2018 17:52:57 +0800 Subject: [PATCH 2/9] fix[parseTime]: fix getDay() bug --- src/utils/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/utils/index.js b/src/utils/index.js index 3e540802..43a374e4 100644 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -25,7 +25,8 @@ export function parseTime(time, cFormat) { } const time_str = format.replace(/{(y|m|d|h|i|s|a)+}/g, (result, key) => { let value = formatObj[key] - if (key === 'a') { return ['一', '二', '三', '四', '五', '六', '日'][value - 1] } + // Note: getDay() returns 0 on Sunday + if (key === 'a') { return ['日', '一', '二', '三', '四', '五', '六'][value ] } if (result.length > 0 && value < 10) { value = '0' + value } 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 3/9] 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 @@