mirror of
https://gitee.com/dromara/go-view.git
synced 2024-12-02 03:38:27 +08:00
fix: 修改语言获取位置
This commit is contained in:
parent
39ab04e051
commit
caadad501f
@ -15,7 +15,7 @@
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { useLangStore } from '@/store/modules/langStore/langStore'
|
||||
import { langList } from '@/settings/designSetting'
|
||||
import { langList } from '@/i18n/index'
|
||||
import { LangEnum } from '@/enums/styleEnum'
|
||||
import { icon } from '@/plugins'
|
||||
|
||||
|
@ -3,18 +3,32 @@ import { lang } from '@/settings/designSetting'
|
||||
import { createI18n } from 'vue-i18n' //引入vue-i18n组件
|
||||
import { getLocalStorage } from '@/utils'
|
||||
import { StorageEnum }from '@/enums/storageEnum'
|
||||
import { LangEnum } from '@/enums/styleEnum'
|
||||
import { LangStateType } from '@/store/modules/langStore/langStore.d'
|
||||
import zh from './zh/index'
|
||||
import en from './en/index'
|
||||
|
||||
const langStorage: LangStateType = getLocalStorage(StorageEnum.GO_LANG_STORE)
|
||||
|
||||
|
||||
// 语言数组
|
||||
export const langList = [
|
||||
{
|
||||
label: '中文',
|
||||
key: LangEnum.zh
|
||||
},
|
||||
{
|
||||
label: 'English',
|
||||
key: LangEnum.en
|
||||
}
|
||||
]
|
||||
|
||||
const i18n = createI18n({
|
||||
locale: langStorage?.lang || lang,
|
||||
globalInjection: true,
|
||||
messages: {
|
||||
zh: zh,
|
||||
en: en
|
||||
[LangEnum.zh]: zh,
|
||||
[LangEnum.en]: en
|
||||
}
|
||||
})
|
||||
|
||||
|
@ -3,18 +3,6 @@ import { LangEnum } from '@/enums/styleEnum'
|
||||
// 默认语言
|
||||
export const lang = LangEnum.zh
|
||||
|
||||
// 语言数组
|
||||
export const langList = [
|
||||
{
|
||||
label: '中文',
|
||||
key: LangEnum.zh
|
||||
},
|
||||
{
|
||||
label: 'English',
|
||||
key: LangEnum.en
|
||||
}
|
||||
]
|
||||
|
||||
// 主体色
|
||||
export const appThemeList: string[] = [
|
||||
'#2d8cf0',
|
||||
|
@ -1,4 +0,0 @@
|
||||
export const GO_LOGIN_STORE = 'GO-ACCESS-TOKEN' // 登录信息
|
||||
export const GO_LANG_STORE = 'GO-LANG' // 语言
|
||||
export const GO_DESIGN_STORE = 'GO-DESIGN' // 当前选择的主题
|
||||
export const GO_CHART_LAYOUT_STORE = 'GO-Chart-Layout-Store' // 拖拽页面
|
@ -102,6 +102,7 @@ const emit = defineEmits(['delete', 'resize', 'edit'])
|
||||
const t = window['$t']
|
||||
|
||||
const props = defineProps({
|
||||
// todo 定义列表ITEN的 type
|
||||
cardData: Object
|
||||
})
|
||||
const fnBtnList = reactive([
|
||||
|
Loading…
Reference in New Issue
Block a user