Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
W
web-monitor
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
Administrator
web-monitor
Commits
d54bdc8f
Commit
d54bdc8f
authored
Aug 28, 2018
by
Pan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor[ExternalLink]: tweak externalLink judge
parent
61394e57
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
9 deletions
+10
-9
SidebarItem.vue
src/views/layout/components/Sidebar/SidebarItem.vue
+10
-9
No files found.
src/views/layout/components/Sidebar/SidebarItem.vue
View file @
d54bdc8f
...
...
@@ -2,17 +2,11 @@
<div
v-if=
"!item.hidden&&item.children"
class=
"menu-wrapper"
>
<template
v-if=
"hasOneShowingChild(item.children) && !onlyOneChild.children&&!item.alwaysShow"
>
<a
v-if=
"isExternalLink(onlyOneChild.path)"
:href=
"onlyOneChild.path"
target=
"blank"
>
apple
<a
:href=
"onlyOneChild.path"
target=
"_blank"
@
click=
"clickLink(onlyOneChild.path,$event)"
>
<el-menu-item
:index=
"resolvePath(onlyOneChild.path)"
:class=
"
{'submenu-title-noDropdown':!isNest}">
<item
v-if=
"onlyOneChild.meta"
:icon=
"onlyOneChild.meta.icon"
:title=
"onlyOneChild.meta.title"
/>
</el-menu-item>
</a>
<router-link
v-else
:to=
"resolvePath(onlyOneChild.path)"
>
<el-menu-item
:index=
"resolvePath(onlyOneChild.path)"
:class=
"
{'submenu-title-noDropdown':!isNest}">
<item
v-if=
"onlyOneChild.meta"
:icon=
"onlyOneChild.meta.icon"
:title=
"onlyOneChild.meta.title"
/>
</el-menu-item>
</router-link>
</
template
>
<el-submenu
v-else
:index=
"item.name||item.path"
>
...
...
@@ -29,11 +23,11 @@
:base-path=
"resolvePath(child.path)"
class=
"nest-menu"
/>
<
router-link
v-else
:to=
"resolvePath(child.path)"
:key=
"child.name
"
>
<
a
v-else
:href=
"child.path"
:key=
"child.name"
target=
"_blank"
@
click=
"clickLink(child.path,$event)
"
>
<el-menu-item
:index=
"resolvePath(child.path)"
>
<item
v-if=
"child.meta"
:icon=
"child.meta.icon"
:title=
"child.meta.title"
/>
</el-menu-item>
</
router-link
>
</
a
>
</
template
>
</el-submenu>
...
...
@@ -89,6 +83,13 @@ export default {
},
isExternalLink
(
routePath
)
{
return
validateURL
(
routePath
)
},
clickLink
(
routePath
,
e
)
{
if
(
!
this
.
isExternalLink
(
routePath
))
{
e
.
preventDefault
()
const
path
=
this
.
resolvePath
(
routePath
)
this
.
$router
.
push
(
path
)
}
}
}
}
...
...
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