Skip to content

Commit

Permalink
fix: user dropdown event response failure
Browse files Browse the repository at this point in the history
修正顶部用户下拉菜单不响应点击事件的问题
  • Loading branch information
mynetfan committed Jun 26, 2021
1 parent 81a0f47 commit c73694a
Showing 1 changed file with 22 additions and 16 deletions.
38 changes: 22 additions & 16 deletions src/layouts/default/header/components/user-dropdown/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,25 @@
</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"
/>
<MenuDivider v-if="getShowDoc" />
<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"
/>
Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -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,
};
},
});
Expand Down

0 comments on commit c73694a

Please sign in to comment.