[update ueditor] 切换语言
This commit is contained in:
@@ -62,6 +62,16 @@ export default {
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
// 首次加载完所有语言包后,浅拷贝存备份(没有找到正常切换语言的api,暂时先这么处理)
|
||||
if (Object.keys(UE.I18N).length > 1) {
|
||||
window.__COPY_UE_I18N__ = { ...UE.I18N }
|
||||
}
|
||||
// 更新语言包(将备份语言包浅拷贝回来,只保留需要的一个需要的语言包)
|
||||
if (localStorage.getItem('language') === 'en-us') {
|
||||
UE.I18N = { en: window.__COPY_UE_I18N__.en }
|
||||
} else {
|
||||
UE.I18N = { ['zh-cn']: window.__COPY_UE_I18N__['zh-cn'] }
|
||||
}
|
||||
UEDITOR_CONFIG.UEDITOR_HOME_URL = '../../../public/ueditor/'
|
||||
// 初始化UE
|
||||
this.editor = UE.delEditor('editor')
|
||||
|
||||
Reference in New Issue
Block a user