使用 Autoform 和 Meteor.users 创建一个小测试。如果我创建自己的收藏,那很好。但不知何故,我不断收到这个错误,我不知道出了什么问题..
错误:
Uncaught RangeError: Maximum call stack size exceeded
14autoform-inputs.js:162 Uncaught TypeError: Cannot read property 'formValues' of undefined
模板:
{{> loginButtons}}
<div class="container">
<h2>update</h2>
{{> update }}
</div>
</body>
<template name="update">
{{> quickForm collection="Meteor.users"
id="update-user-profile"
type="update"
doc="user"
}}
</template>
带有助手返回当前用户的方案:
Meteor.users.attachSchema(new SimpleSchema({
country: {
type: String,
label: "Country"
},
city: {
type: String,
label: "city"
},
email: {
type: String,
label: "email"
},
story: {
type: String,
label: "your story",
optional: true,
max: 1000
}
}));
if (Meteor.isClient) {
Template.update.helpers({
user: function(){
return Meteor.userId();
}
});
}