我正在使用字典应用,并且架构具有嵌套结构。
articles (collection)
-words (array of objects {"note", "word"} )
-translations (array of objects {"translation", "examples"} )
--examples (array of objects {"example", "translation"} ) that means
examples of word usage with it's translation.
{{> quickForm collection = articles ...}}工作正常,但我想在某些条件下更改模板和功能......
我尝试使用
{{#autoForm collection=articles id="insertArticleForm" class="article-form" }}
{{#afEachArrayItem name='words'}}
{{> afFieldInput name=this.current.note placeholder='schemaLabel' class="note"}}
{{> afFieldInput name=this.current.word placeholder='schemaLabel' class="word"}}
<button type="button" class="autoform-remove-item"><span class="glyphicon glyphicon-remove"></span></button>
{{/afEachArrayItem}}
<button type="button" class="autoform-add-item" data-autoform-field="words"><span class="glyphicon glyphicon-plus"></span></button>
{{/autoForm}}
但它不起作用。 看起来像这个老问题:Meteor: Custom AutoForm with array of objects 但似乎在Meteor/Autoform的最新更新之后,这种语法不起作用....插件的作者几个月来一直没有回答问题(
当我改变{{&gt; afFieldInput name = this.current.note}} to {{&gt; afFieldInput name =&#39; words。$。note&#39;似乎工作,表单显示所有需要字段,但没有在服务器上提交。即使在这个简单的例子中,没有嵌套字段......