{{if result.length>0}} {{each result}} <div class="mui-card" data = '{{$value.title}}'> <div class="mui-card-header mui-card-media" style="height:40vw;background-image:url({{$value.coverimg}})"></div> <div class="mui-card-content"> <div class="mui-card-content-inner"> <p>《{{$value.title}}》 ? {{$value.datetime}}</p> <p style="color: #333;">{{$value.details}}</p> </div> </div> </div> {{/each}} {{else}} <div class="no-anying">暂无数据</div> {{/if}}
怎么给dom 添加data()??, 意思是,,怎么把每个对象赋给.mui-card元素啊。。
回复模板中嵌套模板怎么样?就不能讲清楚一点吗?
<script id="testTemplate" type="text/html"> {{each list}} <span>{{$value.name}}</span> <span>{{$value.age}}</span> {{include 'scoreTemplate' $value}} <!--引入子模板--> {{/each}} </script> <script id="scoreTemplate" type="text/html"> {{each scoreList}} <span>{{$value.name}}</span> <span>{{$value.score}}</span> {{/each}} </script>
IE 下没渲染是什么情况啊