2

アイテムのリストをいつレンダリングするのか疑問に思っています。
Meteor.RenderList と Meteor.Render を使用するのがパフォーマンスにとって最適ですか、それともできるだけテンプレートを使用するようにする必要がありますか?

4

1 に答える 1

0

バックボーン ルーターで Template {{#each}} と Meteor.render を使用します。私はこのようにMeteor.renderをラップする関数を作ります

render: (where, which, options) ->
    self = @
    self.options = options
    $ where.empty().html Meteor.render Template[which]

次に、バックボーンルーター内では次のようになります

routes:
    '': 'home'

home: ->
    render 'body', 'page-home'

page-home.html インクルード テンプレートと {{#each}} を使用してリストを取得します。

<template name="page-home">
    {{> module-streams-list}} blah blah blah
</template>

Meteor.render/Meteor.renderList ページのルーティング方法についても知りたいです。

于 2012-10-15T11:13:04.123 に答える