mirror of
https://github.com/vbenjs/vben-admin-thin-next.git
synced 2025-01-23 17:50:22 +08:00
fix: user dropdown event response failure
修正顶部用户下拉菜单不响应点击事件的问题
This commit is contained in:
parent
81a0f478af
commit
c73694ab8b
@ -10,10 +10,11 @@
|
||||
</span>
|
||||
|
||||
<template #overlay>
|
||||
<Menu @click="handleMenuClick">
|
||||
<Menu>
|
||||
<MenuItem
|
||||
key="doc"
|
||||
:text="t('layout.header.dropdownItemDoc')"
|
||||
@click="openDoc"
|
||||
icon="ion:document-text-outline"
|
||||
v-if="getShowDoc"
|
||||
/>
|
||||
@ -21,11 +22,13 @@
|
||||
<MenuItem
|
||||
v-if="getUseLockPage"
|
||||
key="lock"
|
||||
@click="handleLock"
|
||||
:text="t('layout.header.tooltipLock')"
|
||||
icon="ion:lock-closed-outline"
|
||||
/>
|
||||
<MenuItem
|
||||
key="logout"
|
||||
@click="handleLoginOut"
|
||||
:text="t('layout.header.dropdownItemLoginOut')"
|
||||
icon="ion:power-outline"
|
||||
/>
|
||||
@ -54,7 +57,7 @@
|
||||
|
||||
import { createAsyncComponent } from '/@/utils/factory/createAsyncComponent';
|
||||
|
||||
type MenuEvent = 'logout' | 'doc' | 'lock';
|
||||
//type MenuEvent = 'logout' | 'doc' | 'lock';
|
||||
|
||||
export default defineComponent({
|
||||
name: 'UserDropdown',
|
||||
@ -95,28 +98,31 @@
|
||||
openWindow(DOC_URL);
|
||||
}
|
||||
|
||||
function handleMenuClick(e: { key: MenuEvent }) {
|
||||
switch (e.key) {
|
||||
case 'logout':
|
||||
handleLoginOut();
|
||||
break;
|
||||
case 'doc':
|
||||
openDoc();
|
||||
break;
|
||||
case 'lock':
|
||||
handleLock();
|
||||
break;
|
||||
}
|
||||
}
|
||||
// function handleMenuClick(e: { key: MenuEvent }) {
|
||||
// switch (e.key) {
|
||||
// case 'logout':
|
||||
// handleLoginOut();
|
||||
// break;
|
||||
// case 'doc':
|
||||
// openDoc();
|
||||
// break;
|
||||
// case 'lock':
|
||||
// handleLock();
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
|
||||
return {
|
||||
prefixCls,
|
||||
t,
|
||||
getUserInfo,
|
||||
handleMenuClick,
|
||||
// handleMenuClick,
|
||||
getShowDoc,
|
||||
register,
|
||||
getUseLockPage,
|
||||
handleLoginOut,
|
||||
openDoc,
|
||||
handleLock,
|
||||
};
|
||||
},
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user