Согласно документации Meteor, изменение элементов внутри #isolate блока не приведет к повторному рендерингу родительского шаблона, но я столкнулся с другим поведением для следующего примера, где оба «привет» 'и 'а' вновь делает, когда я изменить 'название':Метеор: изменение подматрицы без повторного рендеринга родительского шаблона
<head>
<title>testing</title>
</head>
<body>
{{> hello}}
</body>
<template name="hello">
{{#isolate}}
{{> a}}
{{/isolate}}
{{#isolate}}
{{> b}}
{{/isolate}}
</template>
<template name='a'>
a: {{title}}
</template>
<template name='b'>
b: {{desc}}
</template>
Вот Javascript
if (Meteor.isClient) {
Template.hello.rendered = function() {
console.log('hello')
};
Template.a.rendered = function() {
console.log('a')
};
Template.b.rendered = function() {
console.log('b')
};
Handlebars.registerHelper('title', function() {
return Session.get('title');
});
Handlebars.registerHelper('desc', function() {
return Session.get('desc');
});
}
Могу ли я что-то искажая? Я видел аналогичный, но без ответа вопрос: Meteor: Changing a subtemplate without changing parent template
Обратите внимание, что '{{#isolate}}' [больше] (https://github.com/meteor/meteor/wiki/Use-Blaze # no-more-constant-isolate-or-preserve) из [Spacebars] (https://github.com/meteor/meteor/blob/devel/packages/spacebars/README.md). –