Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
VueElementTemplate
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
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
黄瑜
VueElementTemplate
Commits
aaf24b46
Commit
aaf24b46
authored
Nov 01, 2017
by
Pan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:levelbar&&tabsview bug
parent
82110160
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
13 deletions
+20
-13
app.js
src/store/modules/app.js
+2
-1
ArticleDetail.vue
src/views/form/components/ArticleDetail.vue
+1
-1
Levelbar.vue
src/views/layout/components/Levelbar.vue
+4
-0
TabsView.vue
src/views/layout/components/TabsView.vue
+13
-11
No files found.
src/store/modules/app.js
View file @
aaf24b46
...
@@ -21,7 +21,8 @@ const app = {
...
@@ -21,7 +21,8 @@ const app = {
if
(
state
.
visitedViews
.
some
(
v
=>
v
.
path
===
view
.
path
))
return
if
(
state
.
visitedViews
.
some
(
v
=>
v
.
path
===
view
.
path
))
return
state
.
visitedViews
.
push
({
state
.
visitedViews
.
push
({
name
:
view
.
name
,
name
:
view
.
name
,
path
:
view
.
path
path
:
view
.
path
,
title
:
view
.
meta
.
title
||
'no-name'
})
})
if
(
!
view
.
meta
.
noCache
)
{
if
(
!
view
.
meta
.
noCache
)
{
state
.
cachedViews
.
push
(
view
.
name
)
state
.
cachedViews
.
push
(
view
.
name
)
...
...
src/views/form/components/ArticleDetail.vue
View file @
aaf24b46
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
<sticky
:className=
"'sub-navbar '+postForm.status"
>
<sticky
:className=
"'sub-navbar '+postForm.status"
>
<template
v-if=
"fetchSuccess"
>
<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>
<el-button
type=
"info"
>
创建form
</el-button>
</router-link>
</router-link>
...
...
src/views/layout/components/Levelbar.vue
View file @
aaf24b46
...
@@ -20,6 +20,10 @@ export default {
...
@@ -20,6 +20,10 @@ export default {
methods
:
{
methods
:
{
getBreadcrumb
()
{
getBreadcrumb
()
{
let
matched
=
this
.
$route
.
matched
.
filter
(
item
=>
item
.
name
)
let
matched
=
this
.
$route
.
matched
.
filter
(
item
=>
item
.
name
)
if
(
matched
.
length
===
0
)
{
this
.
levelList
=
[{
path
:
'/'
,
meta
:
{
title
:
'首页'
}}]
return
}
const
first
=
matched
[
0
]
const
first
=
matched
[
0
]
if
(
first
&&
(
first
.
name
!==
'首页'
||
first
.
path
!==
''
))
{
if
(
first
&&
(
first
.
name
!==
'首页'
||
first
.
path
!==
''
))
{
matched
=
[{
path
:
'/'
,
meta
:
{
title
:
'首页'
}}].
concat
(
matched
)
matched
=
[{
path
:
'/'
,
meta
:
{
title
:
'首页'
}}].
concat
(
matched
)
...
...
src/views/layout/components/TabsView.vue
View file @
aaf24b46
<
template
>
<
template
>
<scroll-pane
class=
'tabs-view-container'
>
<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"
<router-link
class=
"tabs-view-item"
:class=
"isActive(tag)?'active':''"
v-for=
"tag in Array.from(visitedViews)"
:to=
"tag.path"
:key=
"tag.path"
>
:key=
"tag.path"
>
{{
tag
.
title
}}
{{
tag
.
name
}}
<span
class=
'el-icon-close'
@
click=
'closeViewTabs(tag,$event)'
></span>
<span
class=
'el-icon-close'
@
click=
'closeViewTabs(tag,$event)'
></span>
</router-link>
</router-link>
</scroll-pane>
</scroll-pane>
...
@@ -20,7 +19,7 @@ export default {
...
@@ -20,7 +19,7 @@ export default {
}
}
},
},
mounted
()
{
mounted
()
{
this
.
$store
.
dispatch
(
'addVisitedViews'
,
this
.
generateRoute
()
)
this
.
addViewTabs
(
)
},
},
methods
:
{
methods
:
{
closeViewTabs
(
view
,
$event
)
{
closeViewTabs
(
view
,
$event
)
{
...
@@ -37,17 +36,20 @@ export default {
...
@@ -37,17 +36,20 @@ export default {
$event
.
preventDefault
()
$event
.
preventDefault
()
},
},
generateRoute
()
{
generateRoute
()
{
if
(
this
.
$route
.
matched
[
this
.
$route
.
matched
.
length
-
1
].
name
)
{
if
(
this
.
$route
.
name
)
{
return
this
.
$route
.
matched
[
this
.
$route
.
matched
.
length
-
1
]
return
this
.
$route
}
}
this
.
$route
.
matched
[
0
].
path
=
'/'
return
false
return
this
.
$route
.
matched
[
0
]
},
},
addViewTabs
()
{
addViewTabs
()
{
this
.
$store
.
dispatch
(
'addVisitedViews'
,
this
.
generateRoute
())
const
route
=
this
.
generateRoute
()
if
(
!
route
)
{
return
false
}
this
.
$store
.
dispatch
(
'addVisitedViews'
,
route
)
},
},
isActive
(
path
)
{
isActive
(
route
)
{
return
path
===
this
.
$route
.
path
return
route
.
path
===
this
.
$route
.
path
||
route
.
name
===
this
.
$route
.
name
}
}
},
},
...
...
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