如何使用{{#isolate}}?我找不出什麼Meteor {{#isolate}}。有沒有例子?
如果我做一個頁面一堆模板,如:
{{> page1}}
<template name="template1">reactive source1</template>
<template name="template2">reactive source2</template>
<template name="template3">reactive source3</template>
<template name="template4">reactive source4</template>
<template name="template5">reactive source5</template>
<template name="page1">
{{> template1}}
{{> template2}}
{{> template3}}
{{> template4}}
{{> template5}}
</template>
如果每個單一模板中包含的內容更新,將它重新呈現整個頁面每次?我如何阻止這種情況發生?
在這種情況下我應該使用isolate
嗎?
如果我綁定任何幫手,這些模板,如:
Template.template1.rendered = ->
console.log 'rendered at: ' + new Date().getTime()
它將使至少5倍,因爲我有5個反應性來源。如果它們中的每一個都包含 被動列表,則它將被呈現docs.length時間。
我無法控制單個模板實例。
對不起,我的英語。
下面是與此相關的,我已經在GitHub上發佈的前一個問題:https://github.com/meteor/meteor/issues/435
的Template.foo.rendered回調被調用,但實際上沒有被重新渲染扔我一個循環。顯然,流星人都知道這個令人困惑的術語,並且已經在新的UI引擎中修復。見https://github.com/meteor/meteor/issues/1294 – alnafie
#isolate,#constant和保留都已被刪除:https://github.com/meteor/meteor/wiki/Using-Blaze#no-更恆定分離或 - 保存 – Aaron