问题
If I have the following template structure
<template name="A">
{{> B}}
{{> C}}
</template>
How can I have C update when it changes without having Template A re-render?
I've tried {{#isolate}}{{> C}}{{/isolate}}
but this doesn't work and using a constant region isn't quite right either as this isn't a constant region.
回答1:
As of Meteor 0.7.0.1, re-rendering a sub-template causes the parent to re-render but not sibling templates. Isolate works the same way.
I put together a simple example of this that you can play with here:
https://github.com/alanning/meteor-subtemplate-isolate-test
Keep in mind that this behavior may change with the upcoming release of Meteor UI in preparation for Meteor 1.0.
来源:https://stackoverflow.com/questions/16005848/meteor-changing-a-subtemplate-without-changing-parent-template