File tree 4 files changed +19
-0
lines changed
4 files changed +19
-0
lines changed Original file line number Diff line number Diff line change 10
10
"dependencies" : {
11
11
"@xunlei/vue-context-menu" : " ^1.0.2" ,
12
12
"axios" : " ^0.19.0" ,
13
+ "dayjs" : " ^1.8.33" ,
13
14
"babel-polyfill" : " ^6.26.0" ,
14
15
"core-js" : " ^3.4.3" ,
15
16
"element-ui" : " ^2.13.2" ,
Original file line number Diff line number Diff line change 1
1
import Vue from 'vue' ;
2
2
3
+ /**
4
+ * 格式化时间
5
+ */
6
+ Vue . filter ( 'formatDate' , function ( value , template ) {
7
+ if ( value == null ) {
8
+ return null ;
9
+ }
10
+ return dayjs ( value ) . format ( ! ! template ? template : 'YYYY-MM-DD HH:mm:ss' )
11
+ } ) ;
3
12
// 数字加千分符
4
13
Vue . filter ( 'T' , value => Number ( value ) . toLocaleString ( ) ) ;
Original file line number Diff line number Diff line change @@ -18,6 +18,10 @@ Vue.use(ViewUI);
18
18
// 引入全局工具函数
19
19
import * as utils from "./utils" ;
20
20
// 引入全局过滤器
21
+ import * as filters from '@/filters' ;
22
+ Object . keys ( filters ) . forEach ( ( key ) => {
23
+ Vue . filter ( key , filters [ key ] ) ;
24
+ } ) ;
21
25
// import '@/filters'
22
26
import "font-awesome/scss/font-awesome.scss" ;
23
27
// 在入口处引入模拟的假数据
Original file line number Diff line number Diff line change @@ -2609,6 +2609,11 @@ dashdash@^1.12.0:
2609
2609
dependencies :
2610
2610
assert-plus "^1.0.0"
2611
2611
2612
+ dayjs@^1.8.33 :
2613
+ version "1.10.4"
2614
+ resolved "https://registry.yarnpkg.com/dayjs/-/dayjs-1.10.4.tgz#8e544a9b8683f61783f570980a8a80eaf54ab1e2"
2615
+ integrity sha512-RI/Hh4kqRc1UKLOAf/T5zdMMX5DQIlDxwUe3wSyMMnEbGunnpENCdbUgM+dW7kXidZqCttBrmw7BhN4TMddkCw==
2616
+
2612
2617
de-indent@^1.0.2 :
2613
2618
version "1.0.2"
2614
2619
resolved "https://registry.yarnpkg.com/de-indent/-/de-indent-1.0.2.tgz#b2038e846dc33baa5796128d0804b455b8c1e21d"
You can’t perform that action at this time.
0 commit comments