-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
147 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import i18n from '@/locales/index' | ||
import zh_Cn from 'element-plus/lib/locale/lang/zh-cn' | ||
import en from 'element-plus/lib/locale/lang/en' | ||
import { computed } from '@vue/reactivity' | ||
|
||
export const useI18n = () => i18n.global | ||
|
||
export const t = (key: string) => key | ||
|
||
export const deffElementLocale = () => { | ||
const { locale } = useI18n() | ||
|
||
const tolocale = computed(() => { | ||
if (locale.value == 'en') return en | ||
else return zh_Cn | ||
}) | ||
|
||
return { tolocale } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,30 @@ | ||
import { createApp } from 'vue' | ||
import ElementPlus from 'element-plus' | ||
|
||
import 'element-plus/dist/index.css' | ||
import 'es6-promise/auto' | ||
import 'virtual:svg-icons-register' | ||
|
||
import { store, key } from './store' | ||
import Router from './router' | ||
import I18n from './locales' | ||
import App from './App.vue' | ||
|
||
import { | ||
configMainComponent, | ||
configMainElementPlus, | ||
configMainGlobalProperties, | ||
} from './utils/mainConfig' | ||
import { configMainStore } from './store' | ||
import { configMainI18n } from './locales' | ||
import { configMainRouter } from './router' | ||
|
||
const app = createApp(App) | ||
|
||
configMainComponent(app) | ||
|
||
// 全局钩子 | ||
configMainGlobalProperties(app) | ||
|
||
app | ||
.use(store, key) | ||
.use(Router) | ||
.use(ElementPlus, { | ||
i18n: I18n.global.t, | ||
}) | ||
.use(I18n) | ||
.mount('#app') | ||
// Vuex | ||
configMainStore(app) | ||
|
||
// 路由 | ||
configMainRouter(app) | ||
|
||
// 国际化 | ||
configMainI18n(app) | ||
|
||
// ElementPlus | ||
configMainElementPlus(app) | ||
|
||
app.mount('#app') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.