我是新来做的反应,以及用户界面,我想从我的ajax调用服务器收到的JSON响应创建一个漂亮的表。我怎样才能做到这一点。在reactJS中创建一个来自json响应的动态表
任何形式的信息都会非常有帮助。
var Contact = React.createClass({
getInitialState: function(){
return {}
},
submit: function (e){
var self
e.preventDefault()
self = this
console.log(this.state);
var data = {
Id: this.state.name,
User: this.state.email,
}
$.ajax({
type: 'POST',
dataType: 'json',
url: 'http://localhost:8080/ui/start',
data: JSON.stringify({
Id: this.state.name,
User: this.state.email,
})
})
.done(function(response) {
console.log(response);
// This is where I have the JSON response .How can I create a dynamic table from this response **strong text**and render in on UI. //
}
我的回答是这样的{ '名': '迪夫亚', 'ID': '1', '任务': '某某'}
感谢。