当修改管理台语言的时候,富文本语言也变化
This commit is contained in:
parent
1fd60d0d8c
commit
c166aece5e
|
@ -46,7 +46,16 @@ export default {
|
||||||
hasChange: false,
|
hasChange: false,
|
||||||
hasInit: false,
|
hasInit: false,
|
||||||
tinymceId: this.id,
|
tinymceId: this.id,
|
||||||
fullscreen: false
|
fullscreen: false,
|
||||||
|
languageTypeList: {
|
||||||
|
'en': 'en',
|
||||||
|
'zh': 'zh_CN'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
language() {
|
||||||
|
return this.languageTypeList[this.$store.getters.language]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
@ -55,6 +64,10 @@ export default {
|
||||||
this.$nextTick(() =>
|
this.$nextTick(() =>
|
||||||
window.tinymce.get(this.tinymceId).setContent(val || ''))
|
window.tinymce.get(this.tinymceId).setContent(val || ''))
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
language() {
|
||||||
|
this.destroyTinymce()
|
||||||
|
this.$nextTick(() => this.initTinymce())
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
@ -73,6 +86,7 @@ export default {
|
||||||
initTinymce() {
|
initTinymce() {
|
||||||
const _this = this
|
const _this = this
|
||||||
window.tinymce.init({
|
window.tinymce.init({
|
||||||
|
language: this.language,
|
||||||
selector: `#${this.tinymceId}`,
|
selector: `#${this.tinymceId}`,
|
||||||
height: this.height,
|
height: this.height,
|
||||||
body_class: 'panel-body ',
|
body_class: 'panel-body ',
|
||||||
|
|
Loading…
Reference in New Issue