草庐IT

subcomponent

全部标签

javascript - react / enzyme : How to test for subcomponent?

这就是我的Messenger组件的样子。如您所见,有一个主要组件和一个列表组件。主要组件默认导出。有了这个,我的应用程序中的一切都按预期工作。/imports/ui/components/messenger.jsximportReact,{Component}from'react'importPropTypesfrom'prop-types'import{Container,Segment,Loader,Header}from'semantic-ui-react'classMessengerextendsComponent{staticgetpropTypes(){return{dat

javascript - React 组件和模块导出

我不明白module.exports如何只能导出一个依赖于子组件但仍呈现在DOM中的组件,尽管该子组件从未导出过。//组件.jsvarSubComponent=React.createClass({...});varComponent=React.createClass({...render:function(){return(stuff`)}});module.exports=Component//main.jsvarComponent=require('./component.js');varMainContainer=React.createClass({render:funct

php - Zend Framework 2 Architecture(如何降低模块之间的耦合)?

一个ZF2系统中有许多组件。每个组件都有自己的表示层、业务层和数据层。问题是当组件Foo有一个使用组件Bar的数据层的Controller时。例子:\modules\Foo;onemodule(thisdirectory)canbeaddedorremoved\view;presentationlayer(view)forallsubcomponents\Subcomponent1\Action1\Subcomponent2\Action2...\src\Subcomponent1\Entity;datalayer(model)\Controller;businesslayer(con

android - Dagger 2 : Error about subcomponents, 但我的应用程序中没有任何子组件

我正在尝试在我的应用中使用Dagger2。我不断收到此错误:Error:Executionfailedfortask':app:compileDebugJavaWithJavac'.java.lang.IllegalArgumentException:@dagger.Moduledoesnotdefineanelementsubcomponents()我根本不在应用程序中使用子组件,所以我不知道为什么会出现此错误。我有一个模块和一个组件。模块:@Singleton@ModulepublicclassApplicationModule{privatefinalWSTApplication

android - Dagger 2 : Injecting to Activities from multiple subcomponents

Thistutorial在一个非常简单的示例中展示了如何使用Dagger2的AndroidInjectionModule将依赖项注入(inject)Activity。我的用例有点复杂:AppextendsApplicationimplementsHasDispatchingActivityInjector,ActivityOne使用ActivityModule进行初始化。使用此Activity,创建依赖项DepOne,ActivityTwo具有依赖项DepTwo,如果没有预先存在的DepOne则无法正确初始化。我想到的解决方案是:创建一个AppComponent作为应用的主要组件,创建