Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
InJoyU
vue-element-admin
提交
aaf24b46
V
vue-element-admin
项目概览
InJoyU
/
vue-element-admin
与 Fork 源项目一致
从无法访问的项目Fork
通知
5
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vue-element-admin
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
aaf24b46
编写于
11月 01, 2017
作者:
P
Pan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix:levelbar&&tabsview bug
上级
82110160
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
20 addition
and
13 deletion
+20
-13
src/store/modules/app.js
src/store/modules/app.js
+2
-1
src/views/form/components/ArticleDetail.vue
src/views/form/components/ArticleDetail.vue
+1
-1
src/views/layout/components/Levelbar.vue
src/views/layout/components/Levelbar.vue
+4
-0
src/views/layout/components/TabsView.vue
src/views/layout/components/TabsView.vue
+13
-11
未找到文件。
src/store/modules/app.js
浏览文件 @
aaf24b46
...
...
@@ -21,7 +21,8 @@ const app = {
if
(
state
.
visitedViews
.
some
(
v
=>
v
.
path
===
view
.
path
))
return
state
.
visitedViews
.
push
({
name
:
view
.
name
,
path
:
view
.
path
path
:
view
.
path
,
title
:
view
.
meta
.
title
||
'
no-name
'
})
if
(
!
view
.
meta
.
noCache
)
{
state
.
cachedViews
.
push
(
view
.
name
)
...
...
src/views/form/components/ArticleDetail.vue
浏览文件 @
aaf24b46
...
...
@@ -5,7 +5,7 @@
<sticky
:className=
"'sub-navbar '+postForm.status"
>
<template
v-if=
"fetchSuccess"
>
<router-link
style=
"margin-right:15px;"
v-show=
'isEdit'
:to=
"
{ path:'create'}">
<router-link
style=
"margin-right:15px;"
v-show=
'isEdit'
:to=
"
{ path:'create
-form
'}">
<el-button
type=
"info"
>
创建form
</el-button>
</router-link>
...
...
src/views/layout/components/Levelbar.vue
浏览文件 @
aaf24b46
...
...
@@ -20,6 +20,10 @@ export default {
methods
:
{
getBreadcrumb
()
{
let
matched
=
this
.
$route
.
matched
.
filter
(
item
=>
item
.
name
)
if
(
matched
.
length
===
0
)
{
this
.
levelList
=
[{
path
:
'
/
'
,
meta
:
{
title
:
'
首页
'
}}]
return
}
const
first
=
matched
[
0
]
if
(
first
&&
(
first
.
name
!==
'
首页
'
||
first
.
path
!==
''
))
{
matched
=
[{
path
:
'
/
'
,
meta
:
{
title
:
'
首页
'
}}].
concat
(
matched
)
...
...
src/views/layout/components/TabsView.vue
浏览文件 @
aaf24b46
<
template
>
<scroll-pane
class=
'tabs-view-container'
>
<router-link
class=
"tabs-view-item"
:class=
"isActive(tag.path)?'active':''"
v-for=
"tag in Array.from(visitedViews)"
:to=
"tag.path"
:key=
"tag.path"
>
{{
tag
.
name
}}
<router-link
class=
"tabs-view-item"
:class=
"isActive(tag)?'active':''"
v-for=
"tag in Array.from(visitedViews)"
:to=
"tag.path"
:key=
"tag.path"
>
{{
tag
.
title
}}
<span
class=
'el-icon-close'
@
click=
'closeViewTabs(tag,$event)'
></span>
</router-link>
</scroll-pane>
...
...
@@ -20,7 +19,7 @@ export default {
}
},
mounted
()
{
this
.
$store
.
dispatch
(
'
addVisitedViews
'
,
this
.
generateRoute
()
)
this
.
addViewTabs
(
)
},
methods
:
{
closeViewTabs
(
view
,
$event
)
{
...
...
@@ -37,17 +36,20 @@ export default {
$event
.
preventDefault
()
},
generateRoute
()
{
if
(
this
.
$route
.
matched
[
this
.
$route
.
matched
.
length
-
1
].
name
)
{
return
this
.
$route
.
matched
[
this
.
$route
.
matched
.
length
-
1
]
if
(
this
.
$route
.
name
)
{
return
this
.
$route
}
this
.
$route
.
matched
[
0
].
path
=
'
/
'
return
this
.
$route
.
matched
[
0
]
return
false
},
addViewTabs
()
{
this
.
$store
.
dispatch
(
'
addVisitedViews
'
,
this
.
generateRoute
())
const
route
=
this
.
generateRoute
()
if
(
!
route
)
{
return
false
}
this
.
$store
.
dispatch
(
'
addVisitedViews
'
,
route
)
},
isActive
(
path
)
{
return
path
===
this
.
$route
.
path
isActive
(
route
)
{
return
route
.
path
===
this
.
$route
.
path
||
route
.
name
===
this
.
$route
.
name
}
},
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录