Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
X
x-learn
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
x-learn
Commits
d3e1b1ed
提交
d3e1b1ed
authored
1月 22, 2021
作者:
王鹏飞
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
router 优化
上级
3f051998
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
17 行增加
和
7 行删除
+17
-7
aside.vue
src/components/layout/aside.vue
+12
-6
index.js
src/router/index.js
+5
-1
没有找到文件。
src/components/layout/aside.vue
浏览文件 @
d3e1b1ed
...
@@ -8,13 +8,18 @@
...
@@ -8,13 +8,18 @@
<span
@
click=
"logout"
>
退出登录
</span>
<span
@
click=
"logout"
>
退出登录
</span>
</div>
</div>
</div>
</div>
<el-menu
class=
"nav"
:unique-opened=
"true"
:
router=
"true"
:
default-active=
"activeLink"
>
<el-menu
class=
"nav"
:unique-opened=
"true"
:default-active=
"activeLink"
>
<template
v-for=
"item in datalist"
>
<template
v-for=
"item in datalist"
>
<el-submenu
:index=
"item.title"
:key=
"item.title"
v-if=
"item.children"
>
<el-submenu
:index=
"item.title"
:key=
"item.title"
v-if=
"item.children"
>
<template
#
title
>
<template
#
title
>
<i
class=
"iconfont"
:class=
"item.icon"
></i><span>
{{
item
.
title
}}
</span>
<i
class=
"iconfont"
:class=
"item.icon"
></i><span>
{{
item
.
title
}}
</span>
</
template
>
</
template
>
<el-menu-item
:index=
"item.path"
:key=
"item.title"
v-for=
"item in item.children"
>
<el-menu-item
:index=
"item.path"
:key=
"item.title"
v-for=
"item in item.children"
@
click=
"handleClick(item.path)"
>
<
template
#
title
>
<
template
#
title
>
<template
v-if=
"item.href"
>
<template
v-if=
"item.href"
>
<a
:href=
"item.href"
target=
"_blank"
>
{{
item
.
title
}}
</a>
<a
:href=
"item.href"
target=
"_blank"
>
{{
item
.
title
}}
</a>
...
@@ -24,7 +29,7 @@
...
@@ -24,7 +29,7 @@
</el-menu-item>
</el-menu-item>
</el-submenu>
</el-submenu>
<el-menu-item
:index=
"item.path"
:key=
"item.title"
v-else
>
<el-menu-item
:index=
"item.path"
:key=
"item.title"
@
click=
"handleClick(item.path)"
v-else
>
<i
class=
"iconfont"
:class=
"item.icon"
></i>
<i
class=
"iconfont"
:class=
"item.icon"
></i>
<span
slot=
"title"
>
{{ item.title }}
</span>
<span
slot=
"title"
>
{{ item.title }}
</span>
</el-menu-item>
</el-menu-item>
...
@@ -64,9 +69,7 @@ export default {
...
@@ -64,9 +69,7 @@ export default {
{
{
title
:
'实训练习'
,
title
:
'实训练习'
,
icon
:
'icon-kaoshihong'
,
icon
:
'icon-kaoshihong'
,
children
:
[
children
:
[{
title
:
'实训案例练习'
,
href
:
'https://xtraining.ezijing.com/'
}]
{
title
:
'实训案例练习'
,
path
:
'https://xtraining.ezijing.com/'
,
href
:
'https://xtraining.ezijing.com/'
}
]
},
},
{
{
title
:
'个人中心'
,
title
:
'个人中心'
,
...
@@ -121,6 +124,9 @@ export default {
...
@@ -121,6 +124,9 @@ export default {
this
.
$store
.
dispatch
(
'logout'
).
then
(()
=>
{
this
.
$store
.
dispatch
(
'logout'
).
then
(()
=>
{
window
.
location
.
href
=
webConf
.
others
.
loginUrl
window
.
location
.
href
=
webConf
.
others
.
loginUrl
})
})
},
handleClick
(
path
)
{
path
&&
this
.
$router
.
push
(
path
)
}
}
}
}
}
}
...
...
src/router/index.js
浏览文件 @
d3e1b1ed
...
@@ -3,7 +3,11 @@ import Router from 'vue-router'
...
@@ -3,7 +3,11 @@ import Router from 'vue-router'
import
routes
from
'./routes'
import
routes
from
'./routes'
Vue
.
use
(
Router
)
Vue
.
use
(
Router
)
const
originalPush
=
Router
.
prototype
.
push
Router
.
prototype
.
push
=
function
push
(
location
,
onResolve
,
onReject
)
{
if
(
onResolve
||
onReject
)
return
originalPush
.
call
(
this
,
location
,
onResolve
,
onReject
)
return
originalPush
.
call
(
this
,
location
).
catch
(
err
=>
err
)
}
export
default
new
Router
({
export
default
new
Router
({
routes
,
routes
,
mode
:
'history'
,
// 还有一个 hash 默认
mode
:
'history'
,
// 还有一个 hash 默认
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论