Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
Support
提交反馈
为 GitLab 提交贡献
登录
切换导航
兵
兵役_吉林工业
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
麦嘉得
兵役_吉林工业
提交
d54bdc8f
提交
d54bdc8f
编写于
8月 28, 2018
作者:
Pan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor[ExternalLink]: tweak externalLink judge
上级
61394e57
变更
1
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
10 行增加
和
9 行删除
+10
-9
SidebarItem.vue
src/views/layout/components/Sidebar/SidebarItem.vue
+10
-9
未找到文件。
src/views/layout/components/Sidebar/SidebarItem.vue
浏览文件 @
d54bdc8f
...
@@ -2,17 +2,11 @@
...
@@ -2,17 +2,11 @@
<div
v-if=
"!item.hidden&&item.children"
class=
"menu-wrapper"
>
<div
v-if=
"!item.hidden&&item.children"
class=
"menu-wrapper"
>
<template
v-if=
"hasOneShowingChild(item.children) && !onlyOneChild.children&&!item.alwaysShow"
>
<template
v-if=
"hasOneShowingChild(item.children) && !onlyOneChild.children&&!item.alwaysShow"
>
<a
v-if=
"isExternalLink(onlyOneChild.path)"
:href=
"onlyOneChild.path"
target=
"blank"
>
<a
:href=
"onlyOneChild.path"
target=
"_blank"
@
click=
"clickLink(onlyOneChild.path,$event)"
>
apple
<el-menu-item
:index=
"resolvePath(onlyOneChild.path)"
:class=
"
{'submenu-title-noDropdown':!isNest}">
<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"
/>
<item
v-if=
"onlyOneChild.meta"
:icon=
"onlyOneChild.meta.icon"
:title=
"onlyOneChild.meta.title"
/>
</el-menu-item>
</el-menu-item>
</a>
</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
>
</
template
>
<el-submenu
v-else
:index=
"item.name||item.path"
>
<el-submenu
v-else
:index=
"item.name||item.path"
>
...
@@ -29,11 +23,11 @@
...
@@ -29,11 +23,11 @@
:base-path=
"resolvePath(child.path)"
:base-path=
"resolvePath(child.path)"
class=
"nest-menu"
/>
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)"
>
<el-menu-item
:index=
"resolvePath(child.path)"
>
<item
v-if=
"child.meta"
:icon=
"child.meta.icon"
:title=
"child.meta.title"
/>
<item
v-if=
"child.meta"
:icon=
"child.meta.icon"
:title=
"child.meta.title"
/>
</el-menu-item>
</el-menu-item>
</
router-link
>
</
a
>
</
template
>
</
template
>
</el-submenu>
</el-submenu>
...
@@ -89,6 +83,13 @@ export default {
...
@@ -89,6 +83,13 @@ export default {
},
},
isExternalLink
(
routePath
)
{
isExternalLink
(
routePath
)
{
return
validateURL
(
routePath
)
return
validateURL
(
routePath
)
},
clickLink
(
routePath
,
e
)
{
if
(
!
this
.
isExternalLink
(
routePath
))
{
e
.
preventDefault
()
const
path
=
this
.
resolvePath
(
routePath
)
this
.
$router
.
push
(
path
)
}
}
}
}
}
}
}
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录