BootstrapTable没有呈现

时间:2018-12-19 23:35:00

标签: reactjs

任何人都可以检查我的代码并告诉我我做错了什么或错过了什么吗?我刚刚开始使用React,我从使用简单表切换到react-bootstrap-tables

https://codepen.io/mnshrt/pen/ebBwKp

   function DetailsTable(props){
     return(
         <ul>
                  <BootstrapTable data={props.vehicleModel}>
                    <TableHeaderColumn dataField="year">{detailHeadersList[0]}</TableHeaderColumn>
                    <TableHeaderColumn dataField="model">{detailHeadersList[1]}</TableHeaderColumn>
                    <TableHeaderColumn dataField="price">{detailHeadersList[2]}</TableHeaderColumn>
                    <TableHeaderColumn dataField="buy">{detailHeadersList[3]}</TableHeaderColumn>
                  </BootstrapTable>
        </ul>
    )
     }


    earlier it was
    function DetailsTable(props){
     return(
         <ul>
            <table>
                <tr>
                    <th>{detailHeadersList[0]}</th>
                    <th>{detailHeadersList[1]}</th>
                    <th>{detailHeadersList[2]}</th>
                    <th>{detailHeadersList[3]}</th>
                </tr>
                <tr>
                    <td>{props.vehicleModel.year}</td>
                    <td>{props.vehicleModel.model}</td>
                    <td>{props.vehicleModel.price}</td>
                    <td><button>Buy Now</button></td>
                </tr>
            </table>
        </ul>
    )

0 个答案:

没有答案