From fee8170792f5ccd8b86863e691bd578630ca44ea Mon Sep 17 00:00:00 2001 From: linhuizi <529246402@qq.com> Date: Mon, 5 Feb 2024 12:47:01 +0800 Subject: [PATCH] fix(Navbar): update svg in dark mode --- apps/client/components/Navbar.vue | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/apps/client/components/Navbar.vue b/apps/client/components/Navbar.vue index 7cbcc2e09..9250e3f42 100644 --- a/apps/client/components/Navbar.vue +++ b/apps/client/components/Navbar.vue @@ -32,9 +32,10 @@ @@ -48,18 +49,21 @@ import { useMessage } from "naive-ui"; import { navigateTo } from "nuxt/app"; import { useRoute } from "vue-router"; -import { useDarkMode } from "~/composables/darkMode"; +import { Theme, useDarkMode } from "~/composables/darkMode"; import MessageBox from "./main/MessageBox.vue"; import { useUserStore } from "~/store/user"; import { useModalBox } from '~/composables/logout/modal' import { cleanToken } from "~/utils/token"; +import { computed } from "vue"; const route = useRoute(); const userStore = useUserStore(); const { handleCloseModal, handleConfirmModal, handleOpenModal, isShowModal } = useModalBox() -const { setDarkMode, toggleDarkMode } = useDarkMode() +const { setDarkMode, toggleDarkMode, darkMode } = useDarkMode() + +const isDarkMode = computed(() => darkMode.value === Theme.DARK) const handleViewUserInfo = () => { navigateTo('/user/info')