您好,
我在本地安装了 discourse,现在正在尝试使用 emberjs 创建一个自定义主题组件。在我的 hbs 文件中,有单选按钮。有人能告诉我如何添加带有默认选中值的 RadioButtons 吗?我在这上面花了几天时间,现在卡在了 RadioButtons 上。任何帮助都将不胜感激。
查看 discourse 源代码后,我做了类似这样的事情
<span class="yes">
<RadioButton
@class="radio"
@name="product_news"
@value="true"
@id="product_news_t"
@checked={{this.user_preferences.spiceworks_newsletter}}
/>
<label for="product_news_t">Yes</label>
</span>
<span class="no">
<RadioButton
@class="radio"
@name="product_news"
@value="false"
@id="product_news_f"
@checked={{this.user_preferences.spiceworks_newsletter}}
/>
<label for="product_news_t">No</label>
</span>