您必须删除 accounts-ui 包并添加包 ian:accounts-ui-bootstrap-3。在这里,您可以使用各种字段(如单选按钮、选择下拉菜单、文本字段等)添加任意数量的字段。
为了让您的工作更轻松,您可以在client\main.js 中复制粘贴以下代码并尝试您的方法,
Accounts.ui.config({
passwordSignupFields: "USERNAME_AND_EMAIL",
forceEmailLowercase: true,
forceUsernameLowercase: true,
forcePasswordLowercase: true,
extraSignupFields: [{
fieldName: 'name',
fieldLabel: 'Full Name',
inputType: 'text',
visible: true,
validate: function(value, errorFunction) {
if (!value) {
errorFunction("Please provide valid Full Name [Max - 50 Characters]");
return false;
} else {
return true;
}
}
}, {
fieldName: 'mobile',
fieldLabel: 'Mobile Number',
inputType: 'text',
visible: true,
validate: function(value, errorFunction) {
if (!value) {
errorFunction("Please provide valid Mobile Number.");
return false;
} else {
return true;
}
}
}
]
});
当你在 UI 上看到时,它会是这样的,
更多信息:
https://github.com/ianmartorell/meteor-accounts-ui-bootstrap-3/blob/master/README.md