Callback when all Template items finished rendering in Meteor?

前端 未结 7 972
-上瘾入骨i
-上瘾入骨i 2020-12-19 09:30

I\'m getting a collection of records and placing them in a Template, having them rendered {{#each}} and I want to display a loading icon until the last DOM node

相关标签:
7条回答
  • 2020-12-19 10:22

    Nesting an item template inside the current one might actually help?

    <template name="stuff">
       {{#each items}}
         {{> itemTemplate}}
       {{/each}}
    </template>
    
    <template name="itemTemplate">
       <div class="coolView">{{cool_stuff}}</div>
    </template>
    

    Now the callback on Template.itemTemplate.rendered may run every time new item is updated into the DOM.

    0 讨论(0)
提交回复
热议问题