Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
member
Overview
Overview
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
member
member
Commits
770430ac
Commit
770430ac
authored
Oct 16, 2020
by
Kyle_Li
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 时间格式化
parent
bb72ee83
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
2 deletions
+21
-2
index.vue
src/components/block-list/index.vue
+21
-2
No files found.
src/components/block-list/index.vue
View file @
770430ac
...
...
@@ -19,7 +19,7 @@
maxlength=
"32"
clearable
>
</el-input>
<
el-button
type=
"primary"
@
click=
"dialogVisible = true"
>
移除白名单
</el-button
>
<
!--
<el-button
type=
"primary"
@
click=
"dialogVisible = true"
>
移除白名单
</el-button>
--
>
</header>
...
...
@@ -33,7 +33,7 @@
label=
"更新时间"
show-overflow-tooltip
>
<template
slot-scope=
"
{row}">
{{
row
.
updateTime
}}
{{
row
.
updateTime
|
formatDate
(
'ymd'
)
}}
<br
/>
{{
row
.
updateTime
|
formatDate
(
'hms'
)
}}
</
template
>
</el-table-column>
...
...
@@ -139,6 +139,25 @@ export default {
}
},
filters
:
{
formatDate
(
val
,
format
)
{
if
(
!
val
)
return
'--'
;
val
=
new
Date
(
val
);
let
y
=
val
.
getFullYear
();
let
m
=
(
val
.
getMonth
()
+
1
).
toString
().
padStart
(
2
,
'0'
);
let
d
=
val
.
getDate
().
toString
().
padStart
(
2
,
'0'
);
let
h
=
val
.
getHours
().
toString
().
padStart
(
2
,
'0'
);
let
mm
=
val
.
getMinutes
().
toString
().
padStart
(
2
,
'0'
);
let
s
=
val
.
getSeconds
().
toString
().
padStart
(
2
,
'0'
);
if
(
format
==
'ymd'
)
{
return
`
${
y
}
-
${
m
}
-
${
d
}
`
;
}
else
if
(
format
==
'hms'
)
{
return
`
${
h
}
:
${
mm
}
:
${
s
}
`
;
}
return
`
${
y
}
-
${
m
}
-
${
d
}
\xa0\xa0\xa0
${
h
}
:
${
mm
}
:
${
s
}
`
;
}
},
methods
:
{
getList
()
{
this
.
load
=
true
;
...
...
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