流星官方教程不引用模板名,而是使用"body“。如果将"body“替换为模板名,它不起作用,但理论上应该起作用。
Template.body.helpers //this works, but why?
Template.task.helpers //this does not work, why?在本教程中似乎没有对此作出解释。
我遗漏了什么?
发布于 2015-08-28 10:31:56
您错过的是默认情况下为<body></body>创建的模板。在body模板中,您得到了由Template.body.helpers管理的每个循环。
Template.task.helpers只能管理直接在<template name="task"></template>中使用的内容。
https://stackoverflow.com/questions/32268708
复制相似问题