我遇到错误 AllCustomers.js:54 Uncaught ReferenceError:初始化之前无法访问'userKisan',但是我已经导入了相关文件,但不知道为什么显示此错误,github代码是{ {3}}
import {userKisan} from '../api/userKisan';
export default withTracker( ( props ) => {
const filesHandle = Meteor.subscribe('userKisan');
const docsReadyYet = filesHandle.ready();
const userKisan = userKisan.find({}).fetch(); // error
return {
docsReadyYet,
userKisan,
};
})(AllCustomers);
答案 0 :(得分:0)
import {userKisandb} from '../api/userKisan';
export default withTracker( ( props ) => {
const filesHandle = Meteor.subscribe('userKisan');
const docsReadyYet = filesHandle.ready();
const userKisan = userKisandb.find({}).fetch();
return {
docsReadyYet,
userKisan,
};
})(AllCustomers);