【问题标题】:Meteor Autoform Display E-mail FieldMeteor Autoform 显示电子邮件字段
【发布时间】:2015-07-17 23:22:36
【问题描述】:

我创建了一个 AutoForm 更新表单,我用文档的内容填充该表单。我很难让 AutoForm 显示存储在文档中的电子邮件地址。

<template name="edit_user_form">
    {{#autoForm schema=schema id="edit_user_form" type="update" collection=Meteor.users doc=selected_user_doc}}
        <fieldset>
            {{> afQuickField name="profile.first_name"}}
            {{> afQuickField name="profile.last_name"}}
        {{> afQuickField name="emails"}}
            {{> afQuickField name="status" options="allowed" noselect=true}}
            {{> afQuickField name="roles" options="allowed" noselect=true}}
            <div>
                <button type="submit" class="btn btn-primary">Submit</button>
                <button type="reset" class="btn btn-default">Reset</button>
            </div>
        </fieldset>
    {{/autoForm}}
</template>

因此,电子邮件输入字段将填充“[object Object]”。

由于我只允许每个用户发送一封电子邮件,那么告诉 AutoForm 使用电子邮件地址填充表单字段的正确方法是什么?谢谢。

【问题讨论】:

    标签: meteor meteor-autoform


    【解决方案1】:

    是的,在流星帐户中,电子邮件被视为一个数组。您可以使用 autoform github 问题中的this notation

    {{> afQuickField name="emails.0.address"}}
    

    【讨论】:

      猜你喜欢
      • 2015-06-10
      • 1970-01-01
      • 2016-04-29
      • 1970-01-01
      • 1970-01-01
      • 2016-09-16
      • 2013-09-24
      • 2016-06-15
      • 1970-01-01
      相关资源
      最近更新 更多