我为某些集合制作编辑表单,它具有Array字段“ phones”,每个元素都是String当我尝试从该字段制作afArrayField时,它显示带有一个空字符串的块
架构:
{phones:
{type: Array,
minCount: 1,
label: "Phones numbers"},
{"phones.$":
{type: String}
}
模板:
{{> afQuickField name="phones" value=phones}}
在对象阵列中显示“电话”
我有以下内容:
phones: {
type: [String],
minCount: 1,
label: "Phones numbers"
},
'phones.$': {
autoform: {
afFieldInput: {
type: 'text'
}
}
}
模板助手
Template.home.helpers({
doc: {phones: ['09988765', '0998776']} // this should come from db.findOne
})
在模板中:
{{#autoForm id='test' schema="Schema.Array" type="update" doc=doc}}
{{> afQuickField name="phones" value=doc.phones}}
{{/autoForm}}
我有这个:
我有以下软件包依赖项:
meteor-platform
standard-app-packages
iron:router
iron:layout
aldeed:collection2
aldeed:simple-schema
aldeed:autoform
nemo64:bootstrap
less
accounts-base
accounts-password
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句