Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/meteor/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Meteor自动表单显示电子邮件字段_Meteor_Meteor Autoform - Fatal编程技术网

Meteor自动表单显示电子邮件字段

Meteor自动表单显示电子邮件字段,meteor,meteor-autoform,Meteor,Meteor Autoform,我已经创建了一个自动表单更新表单,并用文档内容填充该表单。我很难获得自动表单来显示文档中存储的电子邮件地址 <template name="edit_user_form"> {{#autoForm schema=schema id="edit_user_form" type="update" collection=Meteor.users doc=selected_user_doc}} <fieldset> {{> a

我已经创建了一个自动表单更新表单,并用文档内容填充该表单。我很难获得自动表单来显示文档中存储的电子邮件地址

<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>

{{{#autoForm schema=schema id=“edit_user_form”type=“update”collection=Meteor.users doc=selected_user_doc}
{{>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}
提交
重置
{{/autoForm}
因此,电子邮件输入字段中填充了“
[object object]


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

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

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