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
HireTest
VueElementTemplate
Commits
3cb1e321
Commit
3cb1e321
authored
Nov 22, 2017
by
Pan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor:change tabs-view to tags-view
parent
f2fcdee8
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
15 deletions
+15
-15
Layout.vue
src/views/layout/Layout.vue
+3
-3
TagsView.vue
src/views/layout/components/TagsView.vue
+11
-11
index.js
src/views/layout/components/index.js
+1
-1
No files found.
src/views/layout/Layout.vue
View file @
3cb1e321
...
...
@@ -3,14 +3,14 @@
<sidebar
class=
"sidebar-container"
></sidebar>
<div
class=
"main-container"
>
<navbar></navbar>
<ta
bs-view></tab
s-view>
<ta
gs-view></tag
s-view>
<app-main></app-main>
</div>
</div>
</
template
>
<
script
>
import
{
Navbar
,
Sidebar
,
AppMain
,
Ta
b
sView
}
from
'views/layout/components'
import
{
Navbar
,
Sidebar
,
AppMain
,
Ta
g
sView
}
from
'views/layout/components'
export
default
{
name
:
'layout'
,
...
...
@@ -18,7 +18,7 @@ export default {
Navbar
,
Sidebar
,
AppMain
,
Ta
b
sView
Ta
g
sView
},
computed
:
{
sidebar
()
{
...
...
src/views/layout/components/Ta
b
sView.vue
→
src/views/layout/components/Ta
g
sView.vue
View file @
3cb1e321
<
template
>
<scroll-pane
class=
'ta
b
s-view-container'
>
<router-link
class=
"ta
b
s-view-item"
:class=
"isActive(tag)?'active':''"
v-for=
"tag in Array.from(visitedViews)"
:to=
"tag.path"
:key=
"tag.path"
>
<scroll-pane
class=
'ta
g
s-view-container'
>
<router-link
class=
"ta
g
s-view-item"
:class=
"isActive(tag)?'active':''"
v-for=
"tag in Array.from(visitedViews)"
:to=
"tag.path"
:key=
"tag.path"
>
{{
$t
(
'route.'
+
tag
.
title
)
}}
<span
class=
'el-icon-close'
@
click=
'closeViewTa
b
s(tag,$event)'
></span>
<span
class=
'el-icon-close'
@
click=
'closeViewTa
g
s(tag,$event)'
></span>
</router-link>
</scroll-pane>
</
template
>
...
...
@@ -18,10 +18,10 @@ export default {
}
},
mounted
()
{
this
.
addViewTa
b
s
()
this
.
addViewTa
g
s
()
},
methods
:
{
closeViewTa
b
s
(
view
,
$event
)
{
closeViewTa
g
s
(
view
,
$event
)
{
this
.
$store
.
dispatch
(
'delVisitedViews'
,
view
).
then
((
views
)
=>
{
if
(
this
.
isActive
(
view
.
path
))
{
const
latestView
=
views
.
slice
(
-
1
)[
0
]
...
...
@@ -40,7 +40,7 @@ export default {
}
return
false
},
addViewTa
b
s
()
{
addViewTa
g
s
()
{
const
route
=
this
.
generateRoute
()
if
(
!
route
)
{
return
false
...
...
@@ -54,19 +54,19 @@ export default {
},
watch
:
{
$route
()
{
this
.
addViewTa
b
s
()
this
.
addViewTa
g
s
()
}
}
}
</
script
>
<
style
rel=
"stylesheet/scss"
lang=
"scss"
scoped
>
.ta
b
s-view-container
{
.ta
g
s-view-container
{
background
:
#fff
;
height
:
34px
;
border-bottom
:
1px
solid
#d8dce5
;
box-shadow
:
0
1px
3px
0
rgba
(
0
,
0
,
0
,
.12
)
,
0
0
3px
0
rgba
(
0
,
0
,
0
,
.04
);
.ta
b
s-view-item
{
.ta
g
s-view-item
{
display
:
inline-block
;
position
:
relative
;
height
:
26px
;
...
...
@@ -105,8 +105,8 @@ export default {
</
style
>
<
style
rel=
"stylesheet/scss"
lang=
"scss"
>
.ta
b
s-view-container
{
.ta
b
s-view-item
{
.ta
g
s-view-container
{
.ta
g
s-view-item
{
.el-icon-close
{
width
:
16px
;
height
:
16px
;
...
...
src/views/layout/components/index.js
View file @
3cb1e321
export
{
default
as
Navbar
}
from
'./Navbar'
export
{
default
as
Sidebar
}
from
'./Sidebar/index.vue'
export
{
default
as
Ta
bsView
}
from
'./Tab
sView'
export
{
default
as
Ta
gsView
}
from
'./Tag
sView'
export
{
default
as
AppMain
}
from
'./AppMain'
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