-
Notifications
You must be signed in to change notification settings - Fork 0
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
8 changed files
with
210 additions
and
67 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
export default { | ||
"lang.choose": "Choose lang", | ||
"lang.choose.placeholder": "Please select language", | ||
"theme.mode.choose": "Mode", | ||
"theme.mode.dark": "Dark mode", | ||
"theme.mode.light": "Light mode", | ||
"theme.choose": "Choose theme", | ||
"theme.choose.default": "Default theme", | ||
"theme.choose.terwer": "Terwer theme", | ||
"ele.select.placeholder": "Select" | ||
} |
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,11 @@ | ||
export default { | ||
"lang.choose": "语言选择", | ||
"lang.choose.placeholder": "请选择语言", | ||
"theme.mode.choose": "切换模式", | ||
"theme.mode.dark": "暗黑模式", | ||
"theme.mode.light": "浅色模式", | ||
"theme.choose": "主题选择", | ||
"theme.choose.default": "默认主题", | ||
"theme.choose.terwer": "特维主题", | ||
"ele.select.placeholder": "请选择", | ||
} |
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 {createI18n} from 'vue-i18n' | ||
// import {zhCn, en} from "element-plus/es/locale"; | ||
import zh_CN from "~/locales/zh_CN"; | ||
import en_US from "~/locales/en_US"; | ||
|
||
export default defineNuxtPlugin(({vueApp}) => { | ||
const i18n = createI18n({ | ||
legacy: false, | ||
globalInjection: true, | ||
locale: 'zh_CN', // 默认显示语言 | ||
fallbackLocale: 'en_US', // 次要语言 | ||
messages: { | ||
zh_CN, | ||
en_US | ||
}, | ||
}) | ||
|
||
vueApp.use(i18n) | ||
}) |
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,27 @@ | ||
import {defineStore} from "pinia"; | ||
|
||
/** | ||
* 设置配置存储 | ||
*/ | ||
export const useSettingStore = defineStore("layout", () => { | ||
const layout = ref("default") | ||
const lang = ref("zh_CN") | ||
|
||
/** | ||
* 设置新的布局 | ||
* @param ly 布局 | ||
*/ | ||
function setLayout(ly: string) { | ||
layout.value = ly; | ||
} | ||
|
||
/** | ||
* 设置新语言 | ||
* @param l 语言 | ||
*/ | ||
function setLang(l: string) { | ||
lang.value = l | ||
} | ||
|
||
return {layout, setLayout, lang, setLang} | ||
}) |
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