template模板循环嵌套循环

template嵌套循环写法:在第一次循环里面需要循环的地方再写个循环,把要循环的数据对象改为第一层的循环对象别名
//template模板循环嵌套循环
<script id="banner" type="text/html">
            {{each data item}}
            <div class="swiper-slide" >
                {{each item item1}}//each后面的data改变成item 
                <div class="banner-box" cardId={{item1.card_id}}  price={{item1.price}}>
                    <p><i>¥</i><span>{{item1.price}}</span></p>
                    <p>赠 {{item1.price}}MLC</p>
                </div>
                {{/each}}
            </div>
            {{/each}}
</script>

 

模板文档   https://aui.github.io/art-template/zh-cn/docs/installation.html

模板下载地址  https://github.com/aui/art-template

posted @ 2019-06-28 17:17  雪旭  阅读(8512)  评论(0编辑  收藏  举报