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