- {{ $t("lang") }}
-
-
-
+
+
+
+
+
+ {{ isDark ? "Light" : "Dark" }}
+
-
-
- English
- 简体中文
-
-
-
+
+
+
+
+ {{ $t("lang") }}
+
+
+
+
+
+
+ English
+ 简体中文
+
+
+
+
@@ -128,7 +145,14 @@
import { reactive, onMounted, ref } from "vue";
import axios, { AxiosResponse } from "axios";
import { ElMessage } from "element-plus";
+import "element-plus/theme-chalk/dark/css-vars.css";
import { useI18n } from "vue-i18n";
+import { useDark, useToggle } from "@vueuse/core";
+import IconMoon from "@/icons/IconMoon.vue";
+import IconSun from "@/icons/IconSun.vue";
+
+const isDark = useDark();
+const toggleDark = useToggle(isDark);
const url = "./data.json";
@@ -300,9 +324,21 @@ function reset() {
flex-direction: column;
}
-.language {
+.options {
width: 100%;
display: flex;
justify-content: right;
+ margin-right: 20px;
+}
+
+.dark-light-mode {
+ padding-right: 20px;
+ cursor: pointer;
+ color: var(--el-text-color-regular);
+}
+
+.language {
+ display: contents;
+ justify-content: flex-start;
}