diff --git a/app.vue b/app.vue index 6bb99be..ac1289f 100644 --- a/app.vue +++ b/app.vue @@ -23,6 +23,7 @@ import {naiveThemeOverrides} from "~/settings/settings"; const colorMode = useColorMode() const themeOverrides = naiveThemeOverrides + const theme = computed(() => { return colorMode.value === 'system' ? (colorMode.value ? lightTheme : darkTheme) : colorMode.value === 'light' ? lightTheme : darkTheme }) diff --git a/assets/css/main.css b/assets/css/main.css new file mode 100644 index 0000000..b5c61c9 --- /dev/null +++ b/assets/css/main.css @@ -0,0 +1,3 @@ +@tailwind base; +@tailwind components; +@tailwind utilities; diff --git a/components/common/History.vue b/components/common/History.vue index 6b488f5..e507149 100644 --- a/components/common/History.vue +++ b/components/common/History.vue @@ -10,10 +10,10 @@ const {t} = useI18n()
- +
@@ -26,57 +26,60 @@ const {t} = useI18n()

- - {{ t('history.tips', { length: styleStore.getHistory.length }) }} + + {{ t('history.tips', {length: styleStore.getHistory.length}) }}

-
+
- - - - - - - - - - - - - - - - - + + +
- {{ t('history.domain') }} - - {{ t('history.type') }} - - {{ t('history.time') }} - - {{ t('history.actions') }} -
- {{ item.domain }} - - {{ item.type }} - - {{ item.date }} - - + + + + + + + + + + + + + + + + - - -
+ {{ t('history.domain') }} + + {{ t('history.type') }} + + {{ t('history.time') }} + + {{ t('history.actions') }} +
+ {{ item.domain }} + + {{ item.type }} + + {{ item.date }} + + {{t('common.actions.delete')}} -
+ >{{ t('common.actions.delete') }} +
+

{{ t('history.empty') }}

diff --git a/nuxt.config.ts b/nuxt.config.ts index 06eab7f..4c8f059 100644 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -19,6 +19,9 @@ export default defineNuxtConfig({ features: { inlineStyles: true, }, + css: [ + '~/assets/css/main.css', + ], runtimeConfig: { public: { Domain: process.env.WebSiteDomain || 'Nuxt Whois', @@ -53,9 +56,7 @@ export default defineNuxtConfig({ headlessui: { prefix: 'Headless' }, - naiveui: { - colorModePreference: "light", - }, + naiveui: {}, colorMode: { classSuffix: '', }, diff --git a/plugins/setTheme.client.ts b/plugins/setTheme.client.ts deleted file mode 100644 index ad9498a..0000000 --- a/plugins/setTheme.client.ts +++ /dev/null @@ -1,14 +0,0 @@ -export default defineNuxtPlugin((nuxtApp) => { - const colorMode = useColorMode() - - // 页面加载完毕,如果是暗色模式则重新加载,见: https://github.com/tusen-ai/naive-ui/issues/3765#issuecomment-1283356344 - nuxtApp.hook('page:finish', () => { - setTimeout(() => { - colorMode.value = 'light' - - setTimeout(() => { - colorMode.value = colorMode.preference - }, 0) - }, 0) - }) -})