流星自动形成字符串数组显示空字段
meteor autoform string array shows empty field
我为一些集合制作了编辑表单,它有数组字段'phones',每个元素都是字符串
当我尝试从该字段创建 afArrayField 时,它显示带有一个空字符串的块
架构:
{phones:
{type: Array,
minCount: 1,
label: "Phones numbers"},
{"phones.$":
{type: String}
}
模板:
{{> afQuickField name="phones" value=phones}}
在对象数组中呈现'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
我为一些集合制作了编辑表单,它有数组字段'phones',每个元素都是字符串 当我尝试从该字段创建 afArrayField 时,它显示带有一个空字符串的块
架构:
{phones:
{type: Array,
minCount: 1,
label: "Phones numbers"},
{"phones.$":
{type: String}
}
模板:
{{> afQuickField name="phones" value=phones}}
在对象数组中呈现'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