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
a1a96c38
Commit
a1a96c38
authored
Jun 15, 2017
by
Pan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add tabs example
parent
2927e08d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
148 additions
and
3 deletions
+148
-3
index.js
src/router/index.js
+6
-3
tabPane.vue
src/views/example/tab/components/tabPane.vue
+98
-0
index.vue
src/views/example/tab/index.vue
+44
-0
No files found.
src/router/index.js
View file @
a1a96c38
...
@@ -58,6 +58,7 @@ const DragTable = () => import('../views/example/table/dragTable');
...
@@ -58,6 +58,7 @@ const DragTable = () => import('../views/example/table/dragTable');
const
InlineEditTable
=
()
=>
import
(
'../views/example/table/inlineEditTable'
);
const
InlineEditTable
=
()
=>
import
(
'../views/example/table/inlineEditTable'
);
const
Form
=
()
=>
import
(
'../views/example/form'
);
const
Form
=
()
=>
import
(
'../views/example/form'
);
const
Tab
=
()
=>
import
(
'../views/example/tab/index'
);
/* permission */
/* permission */
const
Permission
=
()
=>
import
(
'../views/permission/index'
);
const
Permission
=
()
=>
import
(
'../views/permission/index'
);
...
@@ -198,7 +199,7 @@ export const asyncRouterMap = [
...
@@ -198,7 +199,7 @@ export const asyncRouterMap = [
path
:
'/table'
,
path
:
'/table'
,
component
:
TableLayout
,
component
:
TableLayout
,
redirect
:
'/table/table'
,
redirect
:
'/table/table'
,
name
:
'
t
able'
,
name
:
'
T
able'
,
children
:
[
children
:
[
{
path
:
'dynamictable'
,
component
:
DynamicTable
,
name
:
'动态table'
},
{
path
:
'dynamictable'
,
component
:
DynamicTable
,
name
:
'动态table'
},
{
path
:
'dragtable'
,
component
:
DragTable
,
name
:
'拖拽table'
},
{
path
:
'dragtable'
,
component
:
DragTable
,
name
:
'拖拽table'
},
...
@@ -206,8 +207,10 @@ export const asyncRouterMap = [
...
@@ -206,8 +207,10 @@ export const asyncRouterMap = [
{
path
:
'table'
,
component
:
Table
,
name
:
'综合table'
}
{
path
:
'table'
,
component
:
Table
,
name
:
'综合table'
}
]
]
},
},
{
path
:
'form/edit'
,
component
:
Form
,
name
:
'编辑form'
,
meta
:
{
isEdit
:
true
}
},
{
path
:
'form/edit'
,
component
:
Form
,
name
:
'编辑Form'
,
meta
:
{
isEdit
:
true
}
},
{
path
:
'form/create'
,
component
:
Form
,
name
:
'创建form'
}
{
path
:
'form/create'
,
component
:
Form
,
name
:
'创建Form'
},
{
path
:
'tab/index'
,
component
:
Tab
,
name
:
'Tab'
}
]
]
},
},
{
path
:
'*'
,
redirect
:
'/404'
,
hidden
:
true
}
{
path
:
'*'
,
redirect
:
'/404'
,
hidden
:
true
}
...
...
src/views/example/tab/components/tabPane.vue
0 → 100644
View file @
a1a96c38
<
template
>
<el-table
:data=
"list"
border
fit
highlight-current-row
style=
"width: 100%"
>
<el-table-column
align=
"center"
label=
"序号"
width=
"65"
>
<template
scope=
"scope"
>
<span>
{{
scope
.
row
.
id
}}
</span>
</
template
>
</el-table-column>
<el-table-column
width=
"180px"
align=
"center"
label=
"时间"
>
<
template
scope=
"scope"
>
<span>
{{
scope
.
row
.
timestamp
|
parseTime
(
'{y
}
-{m
}
-{d
}
{h
}
:{i
}
'
)
}}
<
/span
>
<
/template
>
<
/el-table-column
>
<
el
-
table
-
column
min
-
width
=
"300px"
label
=
"标题"
>
<
template
scope
=
"scope"
>
<
span
class
=
"link-type"
@
click
=
"handleUpdate(scope.row)"
>
{{
scope
.
row
.
title
}}
<
/span
>
<
el
-
tag
>
{{
scope
.
row
.
type
}}
<
/el-tag
>
<
/template
>
<
/el-table-column
>
<
el
-
table
-
column
width
=
"110px"
align
=
"center"
label
=
"作者"
>
<
template
scope
=
"scope"
>
<
span
>
{{
scope
.
row
.
author
}}
<
/span
>
<
/template
>
<
/el-table-column
>
<
el
-
table
-
column
width
=
"80px"
label
=
"重要性"
>
<
template
scope
=
"scope"
>
<
wscn
-
icon
-
svg
v
-
for
=
"n in +scope.row.importance"
icon
-
class
=
"wujiaoxing"
class
=
"meta-item__icon"
:
key
=
"n"
/>
<
/template
>
<
/el-table-column
>
<
el
-
table
-
column
align
=
"center"
label
=
"阅读数"
width
=
"95"
>
<
template
scope
=
"scope"
>
<
span
>
{{
scope
.
row
.
pageviews
}}
<
/span
>
<
/template
>
<
/el-table-column
>
<
el
-
table
-
column
class
-
name
=
"status-col"
label
=
"状态"
width
=
"90"
>
<
template
scope
=
"scope"
>
<
el
-
tag
:
type
=
"scope.row.status | statusFilter"
>
{{
scope
.
row
.
status
}}
<
/el-tag
>
<
/template
>
<
/el-table-column
>
<
/el-table
>
<
/template
>
<
script
>
import
{
fetchList
}
from
'api/article_table'
;
export
default
{
name
:
'articleDetail'
,
props
:
{
type
:
{
type
:
String
,
default
:
'CN'
}
}
,
data
()
{
return
{
list
:
null
,
total
:
null
,
listQuery
:
{
page
:
1
,
limit
:
5
,
type
:
this
.
type
,
sort
:
'+id'
}
}
}
,
filters
:
{
statusFilter
(
status
)
{
const
statusMap
=
{
published
:
'success'
,
draft
:
'gray'
,
deleted
:
'danger'
}
;
return
statusMap
[
status
]
}
}
,
created
()
{
this
.
getList
();
}
,
methods
:
{
getList
()
{
this
.
$emit
(
'create'
);
// for test
fetchList
(
this
.
listQuery
).
then
(
response
=>
{
this
.
list
=
response
.
data
.
items
;
this
.
total
=
response
.
data
.
total
;
}
)
}
}
}
<
/script
>
src/views/example/tab/index.vue
0 → 100644
View file @
a1a96c38
<
template
>
<div
class=
"tab-container"
>
<el-tag
type=
"primary"
>
create times :
{{
createdTimes
}}
</el-tag>
<el-tabs
style=
'margin-top:15px;'
v-model=
"activeName"
type=
"border-card"
>
<el-tab-pane
v-for=
"item in tabMapOptions"
:label=
"item.label"
:key=
'item.key'
:name=
"item.key"
>
<keep-alive>
<tab-pane
v-if=
'activeName==item.key'
:type=
'item.key'
@
create=
'showCreatedTimes'
></tab-pane>
</keep-alive>
</el-tab-pane>
</el-tabs>
</div>
</
template
>
<
script
>
import
tabPane
from
'./components/tabPane'
export
default
{
name
:
'tabDemo'
,
components
:
{
tabPane
},
data
()
{
return
{
tabMapOptions
:
[
{
label
:
'中国'
,
key
:
'CN'
},
{
label
:
'美国'
,
key
:
'US'
},
{
label
:
'日本'
,
key
:
'JP'
},
{
label
:
'欧元区'
,
key
:
'EU'
}
],
activeName
:
'CN'
,
createdTimes
:
0
}
},
methods
:
{
showCreatedTimes
()
{
this
.
createdTimes
=
this
.
createdTimes
+
1
;
}
}
}
</
script
>
<
style
scoped
>
.tab-container
{
margin
:
30px
;
}
</
style
>
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