解决element plus升级新版2.3.8后,项目启动报错的问题。

master
vdpAdmin 2023-07-20 11:46:09 +08:00
parent 949a75ea29
commit 3a0f61e316
2 changed files with 1 additions and 21 deletions

View File

@ -1,5 +1,4 @@
<template> <template>
<el-config-provider :locale="elLocale">
<div id="app"> <div id="app">
<VFormDesigner ref="vfDesignerRef" :global-dsv="globalDsv"> <VFormDesigner ref="vfDesignerRef" :global-dsv="globalDsv">
<!-- <!--
@ -9,15 +8,11 @@
--> -->
</VFormDesigner> </VFormDesigner>
</div> </div>
</el-config-provider>
</template> </template>
<script> <script>
import VFormDesigner from './components/form-designer/index.vue' import VFormDesigner from './components/form-designer/index.vue'
import zhCNLang from 'element-plus/lib/locale/lang/zh-cn'
import enUSLang from 'element-plus/lib/locale/lang/en'
export default { export default {
name: 'App', name: 'App',
components: { components: {
@ -25,11 +20,6 @@ export default {
}, },
data() { data() {
return { return {
elLocaleMap: {
'zh-CN': zhCNLang,
'en-US': enUSLang,
},
// //
globalDsv: { globalDsv: {
testApiHost: 'http://www.test.com/api', testApiHost: 'http://www.test.com/api',
@ -39,11 +29,7 @@ export default {
} }
}, },
computed: { computed: {
elLocale() { //
let curLocale = localStorage.getItem('v_form_locale') || 'zh-CN'
return this.elLocaleMap[curLocale]
},
}, },
methods: { methods: {
doTest() { doTest() {

View File

@ -1,9 +1,5 @@
import { createI18n } from './smart-vue-i18n/index' import { createI18n } from './smart-vue-i18n/index'
import enLocaleElement from "element-plus/lib/locale/lang/en";
import zhLocaleElement from "element-plus/lib/locale/lang/zh-cn";
//import locale from "element-plus/lib/locale"
import enLocale from "@/lang/en-US"; import enLocale from "@/lang/en-US";
import zhLocale from "@/lang/zh-CN"; import zhLocale from "@/lang/zh-CN";
import enLocale_render from "@/lang/en-US_render"; import enLocale_render from "@/lang/en-US_render";
@ -16,7 +12,6 @@ const langResources = {
something: { something: {
//... //...
}, },
...enLocaleElement,
...enLocale, ...enLocale,
...enLocale_render, ...enLocale_render,
...enLocale_extension ...enLocale_extension
@ -26,7 +21,6 @@ const langResources = {
something: { something: {
//... //...
}, },
...zhLocaleElement,
...zhLocale, ...zhLocale,
...zhLocale_render, ...zhLocale_render,
...zhLocale_extension ...zhLocale_extension