From 9df9436c56c38a66a73af60611d5b7e9dfdc7f2c Mon Sep 17 00:00:00 2001 From: 7836246 Date: Tue, 26 Mar 2024 11:20:29 +0800 Subject: [PATCH] =?UTF-8?q?:triangular=5Fflag=5Fon=5Fpost:=20=E5=AE=8C?= =?UTF-8?q?=E5=96=84=E6=97=A5=E5=A4=9C=E6=A8=A1=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.vue | 1 + assets/css/main.css | 3 ++ components/common/History.vue | 91 ++++++++++++++++++----------------- nuxt.config.ts | 7 +-- plugins/setTheme.client.ts | 14 ------ 5 files changed, 55 insertions(+), 61 deletions(-) create mode 100644 assets/css/main.css delete mode 100644 plugins/setTheme.client.ts 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) - }) -})