简体   繁体   English

广播组无法在流星模板中工作

[英]radiogroup not working in meteor template

This Meteor code is expected to show the data supplied by the helper but it is now showing any. 预计此流星代码将显示帮助程序提供的数据,但现在会显示任何数据。 What is wrong and how to fix it? 有什么问题以及如何解决?

<template name="options">
  <radiogroup>
    {{#each values}}
      <radio value="{{this.result}}" label="{{this.label}}"></radio>
    {{/each}}
  </radiogroup>
</template>

edit 编辑
The data can be shown if I change the code to: 如果将代码更改为以下内容,则可以显示数据:

<template name="options">
  <div class="twin-group js-radioGroup" data-id={{_id}}>
    <ul class="upShift">
      {{#each values}}
        <li>
          <label class="twin-item">
            <input type="radio" value={{this.result}}>
            <span class="radio-label">{{this.label}}</span>
          </label>
        </li>
      {{/each}}
    </ul>
  </div>
</template>

I do not see you define the radiogroup template so I suppose you use it as a html tag. 我看不到您定义了radiogroup模板,因此我想您将其用作html标签。 The thing is there is no radiogroup tag in HTML, that is why you code does not work. 问题是HTML中没有radiogroup标签,这就是为什么您的代码无法使用的原因。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM