【实例简介】
【实例截图】
【核心代码】
var top = {
height: 30,
backgroundColor: "#000",
color: "#FFF",
fontSize: 20,
listStyle: "none",
};
var listyle = {
float: "left",
}
var Topdiv = React.createClass(
{
render: function(){
return
}
}
);
var Conb = React.createClass({
getInitialState: function(){
return {
name: "",
attr: "",
ke: "",
keyWord: "",
wages: "",
education: "",
company: ""
}
},
componentDidMount: function(){
var i = this.props.i;
$.getJSON("job.json",function(data){
var inf = data["job"];
var info = inf[i];
console.log(info);
this.setState({
name: info["name"],
attr: info["companyAttr"],
ke: info["companyKey"],
keyWord: info["keyWord"],
wages: info["wages"],
education: info["education"],
company: info["company"]
})
}.bind(this));
},
render: function(){
return
{this.state.name}
{this.state.wages}
{this.state.education}
{this.state.company}
}
})
ReactDOM.render(
,
document.getElementById("con")
)
ReactDOM.render(
document.getElementById("conb")
)