【发布时间】:2017-07-04 15:49:15
【问题描述】:
我正在一个项目中工作,其中“超级管理员”用户可以创建其他用户,设置他们的用户名和密码。我有一个 AutoForm quickForm 根据附加到 Meteor.users 集合的 SimpleSchema 呈现表单(使用 Collection2)。
遵循Collection2 docs 将架构附加到用户集合的建议,我的架构如下所示:
Usuarios.schema = new SimpleSchema({
...
username: {
type: String,
},
services: {
type: Object,
optional: true,
blackbox: true
},
"services.password": {
type: String,
optional: true,
autoform: {
type: 'password'
}
},
...
});
但我希望密码字段呈现为用户名之一(没有服务面板)。
我还没有找到解决方法。我需要在架构中有服务对象类型属性,否则用户插入时的验证失败(使用Accounts.createUser()),因此,面板被渲染(因为属性的对象类型)。
关于如何实现所需的模板渲染有什么想法吗?
【问题讨论】:
标签: meteor meteor-autoform simple-schema meteor-collection2