nlw 2020-09-29 19:03 采纳率: 20%
浏览 61
已结题

freemark获取数据失败

图片说明

我要获得0以下的数据,但只能获得0后面的数据

 <ul class="fly-list">
                        <#list pageData.records as post>
                            <li>
                                <a href="user/${post.authorId}" class="fly-avatar">
                                    <img src="${post.authorAvatar}"
                                         alt="${post.authorName}">
                                </a>
                                <h2>
                                    <a class="layui-badge">${post.categoryName}</a>
                                    <a href="jie/detail.html">${post.title}</a>
                                </h2>
                                <div class="fly-list-info">
                                    <a href="user/${post.authorId}" link>
                                        <cite>${post.authorName}</cite>
                                        <!--
                                        <i class="iconfont icon-renzheng" title="认证信息:XXX"></i>
                                        <i class="layui-badge fly-badge-vip">VIP3</i>
                                        -->
                                    </a>

怎么办?

  • 写回答

1条回答 默认 最新

  • Json-Huang 2020-09-29 22:10
    关注

    records是list集合,需要加上索引获取字段值,比如类似post[0].authorAvatar

    评论

报告相同问题?