Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
W
web-monitor
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
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
Administrator
web-monitor
Commits
ee35d1c0
Commit
ee35d1c0
authored
Sep 15, 2017
by
Pan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refine: table demo add status
parent
3f4e9cc5
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
1 deletion
+15
-1
index.vue
src/views/table/index.vue
+15
-1
No files found.
src/views/table/index.vue
View file @
ee35d1c0
...
@@ -11,7 +11,6 @@
...
@@ -11,7 +11,6 @@
{{
scope
.
row
.
title
}}
{{
scope
.
row
.
title
}}
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
label=
"Author"
width=
"110"
align=
"center"
>
<el-table-column
label=
"Author"
width=
"110"
align=
"center"
>
<
template
scope=
"scope"
>
<
template
scope=
"scope"
>
<span>
{{
scope
.
row
.
author
}}
</span>
<span>
{{
scope
.
row
.
author
}}
</span>
...
@@ -22,6 +21,11 @@
...
@@ -22,6 +21,11 @@
{{
scope
.
row
.
pageviews
}}
{{
scope
.
row
.
pageviews
}}
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
class-name=
"status-col"
label=
"Status"
width=
"110"
align=
"center"
>
<
template
scope=
"scope"
>
<el-tag
:type=
"scope.row.status | statusFilter"
>
{{
scope
.
row
.
status
}}
</el-tag>
</
template
>
</el-table-column>
<el-table-column
align=
"center"
prop=
"created_at"
label=
"Display_time"
width=
"200"
>
<el-table-column
align=
"center"
prop=
"created_at"
label=
"Display_time"
width=
"200"
>
<
template
scope=
"scope"
>
<
template
scope=
"scope"
>
<i
class=
"el-icon-time"
></i>
<i
class=
"el-icon-time"
></i>
...
@@ -42,6 +46,16 @@ export default {
...
@@ -42,6 +46,16 @@ export default {
listLoading
:
true
listLoading
:
true
}
}
},
},
filters
:
{
statusFilter
(
status
)
{
const
statusMap
=
{
published
:
'success'
,
draft
:
'gray'
,
deleted
:
'danger'
}
return
statusMap
[
status
]
}
},
created
()
{
created
()
{
this
.
fetchData
()
this
.
fetchData
()
},
},
...
...
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