Blaze默认是否与Meteor完全集成,还是必须手动添加?

时间:2015-07-10 14:55:40

标签: meteor-blaze

我正在尝试根据分配给我的'Card'集合中'card'对象实例的几个属性来渲染svg的属性。我之前从未明确地使用过Blaze,我只是好奇我是否需要将它作为一个包添加,或者它的功能是否已经内置到最新的Meteor版本中。

<template name="card">
  <div class="card svg">
    <!-- <svg class="symbol" style="red" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 768">
      <path d="M511.9 184l-100 200 100 200 100-200" />
    </svg>
    {{#each cards}}
     {{> svgType this}}
   {{/each}}
  </div>
</template>

<template name="svgType">
  {{#each svgTypes }}
  <svg class="color shape quant fill">
    {{> UI.dynamic template=this}}
  </svg>
  {{/each}}
</template>

---然后我在数组中有一个类似于此处采用的方法的模板列表:https://www.discovermeteor.com/blog/blaze-dynamic-template-includes/

所以我正在制作一个模板,用于渲染每张卡片的svg的颜色,形状,数量和填充 - 然后使用svgType模板根据我的逻辑渲染它们(即,if(card) .color ==='r',svg.color ='#12345)

提前感谢您提供的任何见解......

0 个答案:

没有答案