From 45aac151d72f4417e08fe6536ca5a85af6d6ed0e Mon Sep 17 00:00:00 2001 From: xiaomi <391147815@qq.com> Date: Fri, 20 Jul 2018 15:50:49 +0800 Subject: [PATCH 1/4] setLocalStorgae -> setLocalStorage --- .../dashboard/admin/components/TodoList/index.vue | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/views/dashboard/admin/components/TodoList/index.vue b/src/views/dashboard/admin/components/TodoList/index.vue index 34f0241d..207cdbab 100644 --- a/src/views/dashboard/admin/components/TodoList/index.vue +++ b/src/views/dashboard/admin/components/TodoList/index.vue @@ -72,7 +72,7 @@ export default { } }, methods: { - setLocalStorgae() { + setLocalStorage() { window.localStorage.setItem(STORAGE_KEY, JSON.stringify(this.todos)) }, addTodo(e) { @@ -82,30 +82,30 @@ export default { text, done: false }) - this.setLocalStorgae() + this.setLocalStorage() } e.target.value = '' }, toggleTodo(val) { val.done = !val.done - this.setLocalStorgae() + this.setLocalStorage() }, deleteTodo(todo) { this.todos.splice(this.todos.indexOf(todo), 1) - this.setLocalStorgae() + this.setLocalStorage() }, editTodo({ todo, value }) { todo.text = value - this.setLocalStorgae() + this.setLocalStorage() }, clearCompleted() { this.todos = this.todos.filter(todo => !todo.done) - this.setLocalStorgae() + this.setLocalStorage() }, toggleAll({ done }) { this.todos.forEach(todo => { todo.done = done - this.setLocalStorgae() + this.setLocalStorage() }) } }, From 99d1043f42a5040a474e38d2abdc48a0d220b107 Mon Sep 17 00:00:00 2001 From: xiaomi <391147815@qq.com> Date: Wed, 25 Jul 2018 12:31:59 +0800 Subject: [PATCH 2/4] mutations DEL_OTHERS_VIEWS state.cachedViews -> i type is string slice(begin: number, end: number) --- src/store/modules/tagsView.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/store/modules/tagsView.js b/src/store/modules/tagsView.js index 06d092c9..25d513cd 100644 --- a/src/store/modules/tagsView.js +++ b/src/store/modules/tagsView.js @@ -38,7 +38,7 @@ const tagsView = { for (const i of state.cachedViews) { if (i === view.name) { const index = state.cachedViews.indexOf(i) - state.cachedViews = state.cachedViews.slice(index, i + 1) + state.cachedViews = state.cachedViews.slice(index, index + 1) break } } From df2246ef91df76c54ed5ca3c80d5de385337931c Mon Sep 17 00:00:00 2001 From: xiaomi <391147815@qq.com> Date: Wed, 25 Jul 2018 12:31:59 +0800 Subject: [PATCH 3/4] mutations DEL_OTHERS_VIEWS state.cachedViews -> i type is string slice(begin: number, end: number) --- src/store/modules/tagsView.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/store/modules/tagsView.js b/src/store/modules/tagsView.js index 06d092c9..25d513cd 100644 --- a/src/store/modules/tagsView.js +++ b/src/store/modules/tagsView.js @@ -38,7 +38,7 @@ const tagsView = { for (const i of state.cachedViews) { if (i === view.name) { const index = state.cachedViews.indexOf(i) - state.cachedViews = state.cachedViews.slice(index, i + 1) + state.cachedViews = state.cachedViews.slice(index, index + 1) break } } From c166aece5e926f834f672ec242e318f971e92e74 Mon Sep 17 00:00:00 2001 From: xiaomi <391147815@qq.com> Date: Wed, 22 Aug 2018 12:09:22 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E5=BD=93=E4=BF=AE=E6=94=B9=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E5=8F=B0=E8=AF=AD=E8=A8=80=E7=9A=84=E6=97=B6=E5=80=99?= =?UTF-8?q?=EF=BC=8C=E5=AF=8C=E6=96=87=E6=9C=AC=E8=AF=AD=E8=A8=80=E4=B9=9F?= =?UTF-8?q?=E5=8F=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 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 ',