项目目录总结

2017-09-22  本文已影响13人  danihay

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);
上一篇 下一篇

猜你喜欢

热点阅读