为了账号安全,请及时绑定邮箱和手机立即绑定

如何在React中做Ajax 请求

如何在React中做Ajax 请求

慕田峪4524236 2018-07-10 14:14:51
如何在React中做Ajax 请求
查看完整描述

1 回答

?
30秒到达战场

TA贡献1828条经验 获得超6个赞

setTimeout(function () {
callback({username: 'xxx', age: 10});
}, 10);
}

var App = React.createClass({
getInitialState: function () {
return {data: {}};
},
handleSubmit: function (model) {
console.log(model);
//TODO
},
componentDidMount: function () {
loadCommentsFromServer('url', {}, function (data) {
this.setState({
data: data
});
}.bind(this));
},
render: function () {

查看完整回答
反对 回复 2018-08-05
  • 1 回答
  • 0 关注
  • 707 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信