Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/meteor/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
meteor将附加变量传递到模板_Meteor_Meteor Blaze - Fatal编程技术网

meteor将附加变量传递到模板

meteor将附加变量传递到模板,meteor,meteor-blaze,Meteor,Meteor Blaze,我有一个模板,我想通过它的数据上下文传递一个附加变量: <template name="list"> {{#each item}} {{> listItem extraVariable=someValue}} {{/each}} </template> <template name="listItem"> {{extraVariable}} </template> {{{#每项} {{>list

我有一个模板,我想通过它的数据上下文传递一个附加变量:

<template name="list">
    {{#each item}}
        {{> listItem extraVariable=someValue}} 
    {{/each}}
</template>

<template name="listItem">
    {{extraVariable}}
</template>

{{{#每项}
{{>listItem外部变量=someValue}
{{/每个}}
{{extraVariable}}
如果我像上面的代码片段那样做,我似乎会丢失原始的datacontext(来自每个块)。我如何保留原始信息并仍然传递额外信息(我不想使用会话变量)

Meteor 1.2及以上版本:

{{#let x=y}}
let
block helper用于设置新变量,而无需覆盖块内的数据上下文


更多信息:

谢谢,我现在还在文档中找到了{../variable}},它允许您引用父数据上下文中的变量或将上下文作为参数传递,例如,
{{>listItem context=.extra=value}