File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change 52
52
53
53
this .$refs [formName].validate ((valid ) => {
54
54
if (valid){
55
- console .log (this .form .content + ' ,' + this .form .name + " ," + Date .parse (new Date ())/ 1000 );
55
+ // console.log(this.form.content+','+this.form.name+","+Date.parse(new Date())/1000);}
56
+ this .$http ({
57
+ method: ' post' ,
58
+ url: ' http://www.bai3.xyz/comment/add' ,
59
+ data: {
60
+ " name" : this .form .name ,
61
+ " content" : this .form .content
62
+ }
63
+ })
64
+ .then (function (response ) {
65
+ console .log (response);
66
+ })
67
+ .catch (function (error ) {
68
+ console .log (error);
69
+ });
56
70
let _self = this ;
57
71
this .$message ({
58
72
message: ' 留言成功,请去留言列表查看' ,
Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ export default {
41
41
alert (' 6666' )
42
42
}
43
43
},
44
- beforeCreate : function () {
44
+ beforeMount : function () {
45
45
this .$http (" http://www.bai3.xyz/comment/getlist" )
46
46
.then (response => {console .log (response);this .comments = response .data .reverse ()})
47
47
},
You can’t perform that action at this time.
0 commit comments