简单react示例

var DATA = [{
  "status": "IN_PROGRESS",
  "amount": 600.0,
  "loan_time": "2016-08-12 16:07:00",
  "loan_limited": 1,
  "load_no": "JKM16081203NTD"
}, {
  "status": "IN_PROGRESS",
  "amount": 100.0,
  "loan_time": "2016-08-16 14:40:30",
  "loan_limited": 1,
  "load_no": "JKM16081603NTU"
}, {
  "status": "IN_PROGRESS",
  "amount": 500.0,
  "loan_time": "2016-08-16 16:29:58",
  "loan_limited": 1,
  "load_no": "JKM16081603NTW"
}, {
  "status": "IN_PROGRESS",
  "amount": 900.0,
  "loan_time": "2016-08-17 15:20:46",
  "loan_limited": 12,
  "load_no": "JKM16081703NTX"
}];

var React = require('react');
var ReactDOM = require('react-dom');

var List = React.createClass({
  render: function() {
    return (
      
    { this.props.user.map(function(node, i){ return(
  • 账户余额:{ node.amount }

    { node.status == 'IN_PROGRESS' ? '进行中' : '已完成' }

    借款日期:{node.loan_time}

    还款期限:{node.loan_time}

    还款编号:{node.load_no}

  • )}) }
); } }); Content = React.createClass(function() { render: function() { return (
) } }) ReactDOM.render(, document.getElementById('app'));

你可能感兴趣的:(简单react示例)