修复bug

This commit is contained in:
猴赛雷 2024-11-08 16:32:58 +08:00
parent 9a706d3631
commit 7780695079
3 changed files with 15 additions and 13 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "ddei-editor", "name": "ddei-editor",
"version": "1.2.42", "version": "1.2.42-1",
"private": false, "private": false,
"type": "module", "type": "module",
"author": "hoslay <3697355039@qq.com>", "author": "hoslay <3697355039@qq.com>",

View File

@ -68,12 +68,12 @@ export default defineComponent({
] ]
} }
}, },
i18n: { // // i18n: { //
lang: "en_US", // // lang: "ja_JP", //
langs: { // // langs: { //
// "ja_JP": i18nJP // "ja_JP": i18nJP
} // }
}, // },
extensions: [ extensions: [
// // // //
DDeiCoreStandLayout.configuration({ DDeiCoreStandLayout.configuration({

View File

@ -83,7 +83,15 @@ export default {
} }
this.options.extensions.splice(0,0,DDeiCore) this.options.extensions.splice(0,0,DDeiCore)
let editor = DDeiEditor.newInstance(this.id, this.id, true, this.options); let editor = DDeiEditor.newInstance(this.id, this.id, true, this.options);
//
if (this.options?.i18n) {
if (this.options.i18n.langs) {
editor.registerLangs(this.options.i18n.langs)
}
}
editor.setI18nLang(this.options?.i18n?.lang) editor.setI18nLang(this.options?.i18n?.lang)
this.editor = editor this.editor = editor
editor.appContext = getCurrentInstance().appContext editor.appContext = getCurrentInstance().appContext
@ -191,13 +199,7 @@ export default {
if (options?.config?.height) { if (options?.config?.height) {
this.$refs.editor_div.style.height = options?.config?.height + "px"; this.$refs.editor_div.style.height = options?.config?.height + "px";
} }
//
if(options?.i18n){
if(options.i18n.langs){
this.editor.registerLangs(options.i18n.langs)
}
}
// //
if (options?.config?.initData){ if (options?.config?.initData){