我通读了其他可能的相关链接,试图弄明白这一点。我将列出我的代码和我目前拥有的软件包。问题是,在我尝试将Masonry添加到模板后,我才遇到这些错误。我没有引用正确的东西吗?我能错过什么。
<template name ="snippets">
<div class="container">
{{#masonryContainer id='MasonryContainer' columnWidth=25 transitionDuration='0.1s'}}
{{#each snippets}}
{{> snippet}}
{{/each}}
{{/masonryContainer}}
</div>
</template>
<template name ="snippet">
{{#masonryElement 'MasonryContainer'}}
{{#if isLink}}
<a href={{URL}}>
<div class="snippet bordered">{{text}}</div>
</a>
{{else}}
<div class="snippet bordered">{{text}}</div>
{{/if}}
{{/masonryElement}}
</template>
页面将加载,控制台中的错误列表如下所示:
blaze.js?hash=f33d3dfed63a491d24e3aa07ad66c24b5fe8c761:3212 Uncaught Error: No such template: content
at blaze.js?hash=f33d3dfed63a491d24e3aa07ad66c24b5fe8c761:3212
at Blaze.View.<anonymous> (spacebars.js?hash=ebf9381e7fc625d41acb0df14995b7614360858a:68)
at blaze.js?hash=f33d3dfed63a491d24e3aa07ad66c24b5fe8c761:1934
at Function.Template._withTemplateInstanceFunc (blaze.js?hash=f33d3dfed63a491d24e3aa07ad66c24b5fe8c761:3744)
at blaze.js?hash=f33d3dfed63a491d24e3aa07ad66c24b5fe8c761:1932
at Object.Blaze._withCurrentView (blaze.js?hash=f33d3dfed63a491d24e3aa07ad66c24b5fe8c761:2271)
at viewAutorun (blaze.js?hash=f33d3dfed63a491d24e3aa07ad66c24b5fe8c761:1931)
at Tracker.Computation._compute (tracker.js?hash=997515fa2d5b0530ba07741da556c4b36963ef3b:339)
at new Tracker.Computation (tracker.js?hash=997515fa2d5b0530ba07741da556c4b36963ef3b:229)
at Object.Tracker.autorun (tracker.js?hash=997515fa2d5b0530ba07741da556c4b36963ef3b:613)
(anonymous) @ blaze.js?hash=f33d3dfed63a491d24e3aa07ad66c24b5fe8c761:3212
(anonymous) @ spacebars.js?hash=ebf9381e7fc625d41acb0df14995b7614360858a:68
(anonymous) @ blaze.js?hash=f33d3dfed63a491d24e3aa07ad66c24b5fe8c761:1934
Template._withTemplateInstanceFunc @ blaze.js?hash=f33d3dfed63a491d24e3aa07ad66c24b5fe8c761:3744
(anonymous) @ blaze.js?hash=f33d3dfed63a491d24e3aa07ad66c24b5fe8c761:1932
Blaze._withCurrentView @ blaze.js?hash=f33d3dfed63a491d24e3aa07ad66c24b5fe8c761:2271
Spacebars.include:anonymous @ blaze.js?hash=f33d3dfed63a491d24e3aa07ad66c24b5fe8c761:1931
Tracker.Computation._compute @ tracker.js?hash=997515fa2d5b0530ba07741da556c4b36963ef3b:339
Tracker.Computation @ tracker.js?hash=997515fa2d5b0530ba07741da556c4b36963ef3b:229
Tracker.autorun @ tracker.js?hash=997515fa2d5b0530ba07741da556c4b36963ef3b:613
Blaze.View.autorun @ blaze.js?hash=f33d3dfed63a491d24e3aa07ad66c24b5fe8c761:1944
(anonymous) @ spacebars.js?hash=ebf9381e7fc625d41acb0df14995b7614360858a:67
fireCallbacks @ blaze.js?hash=f33d3dfed63a491d24e3aa07ad66c24b5fe8c761:2014
Tracker.nonreactive @ tracker.js?hash=997515fa2d5b0530ba07741da556c4b36963ef3b:640
(anonymous) @ blaze.js?hash=f33d3dfed63a491d24e3aa07ad66c24b5fe8c761:2011
Blaze._withCurrentView @ blaze.js?hash=f33d3dfed63a491d24e3aa07ad66c24b5fe8c761:2271
Blaze._fireCallbacks @ blaze.js?hash=f33d3dfed63a491d24e3aa07ad66c24b5fe8c761:2010
Blaze._createView @ blaze.js?hash=f33d3dfed63a491d24e3aa07ad66c24b5fe8c761:2028
Blaze._materializeView @ blaze.js?hash=f33d3dfed63a491d24e3aa07ad66c24b5fe8c761:2073
materializeDOMInner @ blaze.js?hash=f33d3dfed63a491d24e3aa07ad66c24b5fe8c761:1532
Blaze._materializeDOM @ blaze.js?hash=f33d3dfed63a491d24e3aa07ad66c24b5fe8c761:1474
Blaze._materializeDOM @ blaze.js?hash=f33d3dfed63a491d24e3aa07ad66c24b5fe8c761:1483
(anonymous) @ blaze.js?hash=f33d3dfed63a491d24e3aa07ad66c24b5fe8c761:2113
Tracker.nonreactive @ tracker.js?hash=997515fa2d5b0530ba07741da556c4b36963ef3b:640
Blaze._materializeView @ blaze.js?hash=f33d3dfed63a491d24e3aa07ad66c24b5fe8c761:2079
Blaze.render @ blaze.js?hash=f33d3dfed63a491d24e3aa07ad66c24b5fe8c761:2370
DynamicTemplate.insert @ iron_dynamic-template.js?hash=7644dc7260de827ef1e361a75159fcc8af9fc074:518
Router.insert @ iron_router.js?hash=f36af52c3c2c3d66f1e99d1562e7d6bf92b00c1c:1639
maybeAutoInsertRouter @ iron_router.js?hash=f36af52c3c2c3d66f1e99d1562e7d6bf92b00c1c:1629
setTimeout (async)
(anonymous) @ iron_router.js?hash=f36af52c3c2c3d66f1e99d1562e7d6bf92b00c1c:1627
maybeReady @ meteor.js?hash=6d285d84547b3dad9717a7c89c664b61b45ea3d8:821
loadingCompleted @ meteor.js?hash=6d285d84547b3dad9717a7c89c664b61b45ea3d8:833