Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
najiu-admin-template
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
najiu-frontend
najiu-admin-template
Commits
c73694ab
Commit
c73694ab
authored
Jun 27, 2021
by
无木
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: user dropdown event response failure
修正顶部用户下拉菜单不响应点击事件的问题
parent
81a0f478
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
16 deletions
+22
-16
index.vue
...layouts/default/header/components/user-dropdown/index.vue
+22
-16
No files found.
src/layouts/default/header/components/user-dropdown/index.vue
View file @
c73694ab
...
...
@@ -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
,
};
},
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment