我正在使用AutoForm包,包括Meteor的select2扩展名。
aldeed:自动窗体
aldeed:自动窗体-SELECT2
关于autoform-select2的文档告诉我可以设置使用这样的select2Options:
{{> afQuickField name='finalReviewerComments'select2Options=select2Options}}
我的架构:
finalReviewerComments: {
type: String,
max: 20,
autoform: {
options: [
{label: "Good", value: 0},
{label: "9: Grammar/spelling/formatting/readability", value: 9},
{label: "8: Not a finding", value: 8},
{label: "7: Information missing", value: 7},
{label: "6: Repeated/combined finding", value: 6},
{label: "5: FAQ requirements", value: 5},
{label: "4: Multiple findings in one", value: 4},
{label: "3: Context missing", value: 3},
{label: "2: Country/page number error", value: 2},
{label: "1: Misinterpretation", value: 1}
],
type: "select2"
},
optional: true
}
我尝试将它添加到autoform中的模式中:
afFieldInput: {
select2Options: {
placeholder: "Imaginary text here"
}
}
使用辅助函数select2Options,如文档中所述:
Template.finalReview.helpers({
select2Options: function () {
return {placeholder: "Final Review Comments"};
}
});
这两个选项都不起作用。我怎样才能让它发挥作用?在渲染表单时,我想要一个空的select2输入框。
编辑:只是为了澄清:{allowclear: true}
也没有。