美文网首页
layui中在表格中循环输出数据

layui中在表格中循环输出数据

作者: 陌紫嫣 | 来源:发表于2018-06-08 09:19 被阅读0次

    首先后台给你的数据结构要是这样的:

    数据结构图片地址:http://m.qpic.cn/psb?/V10GGo3D1ucWHC/1jNhz7dX.k4C3Pmu65ywcREmn2zOsUaYkLPwH5mh8dg!/b/dGcBAAAAAAAA&bo=OgR0AQAAAAADF3k!&rf=viewer_4

     <table class="layui-table" lay-skin="line">
                                       <colgroup>
                                            <col width="170">
                                            <col>
                                       </colgroup>
                                      <thead>
                                      <tr>
                                            <th>回访时间</th>
                                            <th>记录内容</th>
                                     </tr>
                                    </thead>
                                <tbody>
                                {{# layui.each(d.data.visit_logs, function(index, visit_log){ }}
                                        <tr>
    
                                            <td>{{ visit_log.created_at }}</td>
                                            <td>{{ visit_log.content }}</td>
                                        </tr>
                                        {{# }); }}
                                        </tbody>
     </table>
    

    相关文章

      网友评论

          本文标题:layui中在表格中循环输出数据

          本文链接:https://www.haomeiwen.com/subject/eajosftx.html