美文网首页
项目目录总结

项目目录总结

作者: danihay | 来源:发表于2017-09-22 18:51 被阅读13次

1.基于meteor下的项目大体目录路径,client -> modules -> orderControl ->action里面主要是连接服务器的方法,在客户端需要与后台进行数据交互时使用,方法写好之后(服务端存在改方法的前提下),在component组件index.js文件中并不存在该方法,可以通过this.props查看。


image.png image.png

此时需要在当前目录的container文件中注入以下代码。
// 从依赖注入层获取数据

export const depsMapper = (context, actions) => ({
    ...actions.purchaseOrders,
    context: () => context,
});
image.png

并且还需要在client ->main.js也注入,此时通过this.props可以查看action中的方法,可以写虚拟的方法做测试使用。

import orderControlModule from './modules/orderControl';
 ...orderControlModule.reducer,
app.loadModule(orderControlModule);

相关文章

网友评论

      本文标题:项目目录总结

      本文链接:https://www.haomeiwen.com/subject/icofextx.html