diff --git a/components/default/HeaderTime.vue b/components/default/HeaderTime.vue index 2b17c7b..6bbe042 100644 --- a/components/default/HeaderTime.vue +++ b/components/default/HeaderTime.vue @@ -1,20 +1,20 @@ @@ -45,9 +45,9 @@ const initData = () => { timeData.value.shengxiao = getShengXiao(); } -initData(); onMounted(() => { if (inBrowser()) { + initData(); setInterval(function () { timeData.value.clientTime = getClientTime(); }, 1000); @@ -62,7 +62,7 @@ export default { \ No newline at end of file diff --git a/locales/en_US.ts b/locales/en_US.ts new file mode 100644 index 0000000..5ac26ed --- /dev/null +++ b/locales/en_US.ts @@ -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" +} \ No newline at end of file diff --git a/locales/zh_CN.ts b/locales/zh_CN.ts new file mode 100644 index 0000000..831295c --- /dev/null +++ b/locales/zh_CN.ts @@ -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": "请选择", +} \ No newline at end of file diff --git a/package.json b/package.json index a7aea51..357da6e 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,8 @@ "sass": "^1.55.0", "typescript": "^4.8.4", "unplugin-element-plus": "^0.4.1", - "vite": "^3.1.6" + "vite": "^3.1.6", + "vue-i18n": "^9.2.2" }, "dependencies": { "@element-plus/icons-vue": "^2.0.9", diff --git a/pages/setting.vue b/pages/setting.vue index ae3684a..47a623a 100644 --- a/pages/setting.vue +++ b/pages/setting.vue @@ -1,79 +1,105 @@