我正在“超级管理员”用户可以创建其他用户并设置他们的用户名和密码的项目中工作。我有一个AutoForm quickForm
根据连接到Meteor.users
集合(使用集合2)的SimpleSchema
呈现表单。 继架构连接到用户收集Collection2 docs的建议,我的模式是这样的:SimpleSchema和AutoForm:将密码字段渲染为单个输入
Usuarios.schema = new SimpleSchema({
...
username: {
type: String,
},
services: {
type: Object,
optional: true,
blackbox: true
},
"services.password": {
type: String,
optional: true,
autoform: {
type: 'password'
}
},
...
});
但我想有密码字段呈现像用户名一(没有服务面板)。 我还没有找到解决这个问题的方法。我需要在架构中使用Services Object类型属性或者在用户插入失败时进行验证(使用Accounts.createUser()
),因此面板被呈现(因为属性的Object类型)。
关于如何实现所需模板渲染的任何想法?
解决方案B工作!由于我的项目结构,我不能使用解决方案A.谢谢。 –