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] =?UTF-8?q?=E5=BD=93=E4=BF=AE=E6=94=B9=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E5=8F=B0=E8=AF=AD=E8=A8=80=E7=9A=84=E6=97=B6=E5=80=99=EF=BC=8C?= =?UTF-8?q?=E5=AF=8C=E6=96=87=E6=9C=AC=E8=AF=AD=E8=A8=80=E4=B9=9F=E5=8F=98?= =?UTF-8?q?=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 ',