【发布时间】:2018-11-06 21:44:45
【问题描述】:
在基于用户输入的表单中呈现组件的“最佳实践”是什么? 当用户单击下拉按钮上的选项 2 时,我希望将第二个输入字段添加到表单中。如果当用户单击另一个选项时显示被清除,我也想要这个。
<form>
<button class='test'>my dropdown button with option 1,2,3</button>
<input type=text> input field 1</input>
<!-- if button clicked options 2, add second input field -->
<input type=text>input field 2</input>
</form>
Template.name.events({
'click .test': function() {
// something to render input field 2
}
)};
谢谢。
【问题讨论】:
-
我正在使用引导程序 4!
标签: meteor meteor-blaze