为什么没有在跳板函数中定义用户?
在反应路由器路由中,跳板被称为onEnter。
import User from '/imports/api/user.js';
const springboard = (nextState, replace, callback) => {
console.log(User.get());
}来自用户的片段:
User = {
get: function() {
return Meteor.user() || {};
},
…
}发布于 2016-08-13 19:12:26
您必须导出要导入的对象:
export default {
get: …注意,导出对象的名称并不重要。您可以给它任何名称,例如,导入时的User。
https://stackoverflow.com/questions/38936032
复制相似问题