1500字范文,内容丰富有趣,写作好帮手!
1500字范文 > vue仿微博评论回复_vue教程2-07 微博评论功能

vue仿微博评论回复_vue教程2-07 微博评论功能

时间:2021-04-05 17:05:02

相关推荐

vue仿微博评论回复_vue教程2-07 微博评论功能

}

});

window.οnlοad=function(){var URL=‘weibo.php‘;newVue({

el:‘.znsArea‘,

data:{//vue的属性、数据

t1:‘‘,

msgData:[]

},

methods:{

add:function(){//发送请求

this.$http({

url:URL,

data:{//后台发送数据

act:‘add‘,

content:this.t1

}

}).then(function(res){var json=res.data;//msgData添加数据

this.msgData.unshift({

content:this.t1,

time:json.time,

acc:0,

ref:0,

id:json.id

});this.t1=‘‘;

});

},

getPageData:function(n){this.$http({

url:URL,

data:{

act:‘get‘,

page:n

}

}).then(function(res){//console.log(res.data);

var arr=res.data;

console.log(arr);for(var i=0; i

content:arr[i].content,

time:arr[i].time,

acc:arr[i].acc,

ref:arr[i].ref,

id:arr[i].id

});

}

});

}

},

created:function(){this.getPageData(1);

}

});

};

(可按 Enter 回复)

暂无留言

{{item.content}}

{{item.time|date}}

{{item.acc}}

{{item.ref}}

删除

1

2

3

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。