From fa998514f7a90d60fe2d7e3446a350ca2ab33024 Mon Sep 17 00:00:00 2001 From: Dream Hunter Date: Fri, 15 Dec 2023 13:40:52 +0800 Subject: [PATCH] fix: menu (#46) --- frontend/src/views/Header.vue | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/frontend/src/views/Header.vue b/frontend/src/views/Header.vue index 51cd98f0..c3fde1a8 100644 --- a/frontend/src/views/Header.vue +++ b/frontend/src/views/Header.vue @@ -16,6 +16,7 @@ const router = useRouter() const isMobile = useIsMobile() const showLogin = ref(false) +const showLogout = ref(false) const password = ref('') const login = async () => { @@ -116,18 +117,13 @@ const menuOptions = computed(() => [ }, { label: () => h( - NPopconfirm, + NButton, { - onPositiveClick: () => logout() + tertiary: true, + ghost: true, + onClick: () => { showLogout.value = true } }, - { - trigger: () => h(NButton, { - tertiary: true, - ghost: true, - }, () => t('logout') - ), - default: () => t('logoutConfirm') - } + { default: () => t('logout') } ), show: !!jwt.value, key: "logout" @@ -143,9 +139,9 @@ const menuOptionsMobile = [ } ), key: "menu", - children: menuOptions + children: menuOptions.value }, -] +]; + + +

{{ t('logoutConfirm') }}

+ +