【发布时间】:2018-01-23 23:57:23
【问题描述】:
我正在尝试实现自己的标签,每个标签都有自己的内容。默认选择的选项卡是选项卡 1。它加载 html 内容和模板就好了。当我尝试切换到其他两个选项卡时,我收到以下错误消息:
错误:预期模板或空,发现:假
在这种情况下,在选项卡 1 中呈现的模板与在选项卡 3 中呈现的模板相同。在选项卡 1 中工作正常,在选项卡 3 中我收到错误消息。
{{#if isSeletedTab 1}}
<div class="col-sm-12 horizontal-list">
<div class="new-store-card">
<img src='./img/add.png' />
<br/>
<span class="new-store-text">Add a new</span>
<br/>
<span class="new-store-text">store</span>
</div>
{{#each store in stores}}
<div class="store-card-container">
{{#if isSelectedStore store.name}}
<div class="edit-store-button">
<img src="./img/edit.png" class="edit-store-button-icon"/>
</div>
{{/if}}
<div class="store-card" id={{store.name}} style="{{#unless isSelectedStore store.name}}opacity: 0.3;{{/unless}}">
<h5 class="store-card-name" id={{store.name}}>{{store.name}}</h5>
<span class="store-card-id" id={{store.name}}>{{store.externalId}}</span>
</div>
</div>
{{/each}}
</div>
{{> users}}
{{else isSeletedTab 2}}
{{> roles}}
{{else isSeletedTab 3}}
{{> users}}
{{/if}}
【问题讨论】:
-
你能告诉我们
users和roles模板的html代码吗?请同时显示标签<template name="XXXX"></template>。顺便说一句,默认情况下,您不能在 {{else}} 中使用条件,也不能在if中放置多个else。 (只是说,也许你有特殊的帮手)
标签: meteor meteor-blaze