首页 > 代码库 > react.js基本操练
react.js基本操练
慢慢了解其它的JS前端框架。。。
var data = http://www.mamicode.com/[{"when": "2 minutes ago", "who": "Jill Dupre", "description": "Created new account"},{ "when": "1 hour ago", "who": "Lose White", "description": "Added fist chapter"},{ "when": "2 hours ago", "who": "Jordan Whash", "description": "Created new account"}];var headings = ["Last updated at", "By Author", "Summary"]var title = "Recent Changes";var App = React.createClass({ render: function(){ var headings = this.props.headings.map(function(heading) { return(<th>{heading}</th>);});var rows = this.props.data.map(function(row){return <tr><td>{row.when}</td><td>{row.who}</td><td>{row.description}</td></tr>})return <div><h1>{this.props.title}</h1><table><thead>{headings}</thead>{rows}</table></div>}});React.render(<App headings={headings} data=http://www.mamicode.com/{data} title={title}/>,>
react.js基本操练
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。