mirror of
https://github.com/dreamhunter2333/cloudflare_temp_email.git
synced 2026-05-24 17:49:52 +08:00
fix: menu (#46)
This commit is contained in:
@@ -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
|
||||
},
|
||||
]
|
||||
];
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -184,6 +180,17 @@ const menuOptionsMobile = [
|
||||
</n-button>
|
||||
</template>
|
||||
</n-modal>
|
||||
<n-modal v-model:show="showLogout" preset="dialog" title="Dialog">
|
||||
<template #header>
|
||||
<div>{{ t('logout') }}</div>
|
||||
</template>
|
||||
<p>{{ t('logoutConfirm') }}</p>
|
||||
<template #action>
|
||||
<n-button @click="login" size="small" tertiary round type="primary">
|
||||
{{ t('logout') }}
|
||||
</n-button>
|
||||
</template>
|
||||
</n-modal>
|
||||
<n-modal v-model:show="showAuth" :closable="false" :closeOnEsc="false" :maskClosable="false" preset="dialog"
|
||||
title="Dialog">
|
||||
<template #header>
|
||||
|
||||
Reference in New Issue
Block a user