File tree Expand file tree Collapse file tree 2 files changed +6
-8
lines changed Expand file tree Collapse file tree 2 files changed +6
-8
lines changed Original file line number Diff line number Diff line change 55
55
// console.log(this.form.content+','+this.form.name+","+Date.parse(new Date())/1000);}
56
56
this .$http ({
57
57
method: ' post' ,
58
- url: ' http://www.bai3.xyz/comment/add ' ,
58
+ url: ' http://www.bai3.xyz/api/getlist/ ' ,
59
59
data: {
60
60
" name" : this .form .name ,
61
61
" content" : this .form .content
Original file line number Diff line number Diff line change 7
7
</div >
8
8
<div class =" info" style =" display : inline-block " >
9
9
<span style =" font-size : 15px ;color : #333 ;" >{{todo.name}}</span ><br />
10
- <span style =" font-size : 12px ;color : #969696 ;" >{{todo.id+"楼."}}{{todo.create_time|data }}</span >
10
+ <span style =" font-size : 12px ;color : #969696 ;" >{{todo.id+"楼."}}{{todo.create_time|date }}</span >
11
11
</div >
12
12
</div >
13
13
{{todo.content}}
@@ -45,22 +45,20 @@ export default {
45
45
},
46
46
beforeMount : function () {
47
47
this .$http (" http://www.bai3.xyz/api/getlist/?format=json" )
48
- .then (response => {this .comments = response .data .reverse ()});
49
- this .$http (" http://www.bai3.xyz/api/users/?format=json" )
50
- .then (response => {this .result = response .data })
48
+ .then (response => {this .comments = response .data });
51
49
},
52
50
53
51
filters: {
54
52
// 时间戳过滤器
55
- data : function (input ){
56
- var d = new Date (input* 1000 );
53
+ date : function (input ){
54
+ var d = new Date (Date . parse ( input) );
57
55
var year = d .getFullYear ();
58
56
var month = d .getMonth () + 1 ;
59
57
var day = d .getDate () < 10 ? ' 0' + d .getDate () : ' ' + d .getDate ();
60
58
var hour = d .getHours () < 10 ? ' 0' + d .getHours () : ' ' + d .getHours ();
61
59
var minutes = d .getMinutes ()< 10 ? ' 0' + d .getMinutes () : ' ' + d .getMinutes ();
62
60
var seconds = d .getSeconds ()< 10 ? ' 0' + d .getSeconds () : ' ' + d .getSeconds ();
63
- return year+ ' . ' + month + ' . ' + day + ' ' + hour + ' :' + minutes + ' :' + seconds;
61
+ return year+ ' - ' + month + ' - ' + day + ' ' + hour + ' :' + minutes + ' :' + seconds;
64
62
}
65
63
}
66
64
}
You can’t perform that action at this time.
0 commit comments