Sections 与 Views
Sections 与 Views
@GroupSectionSpec
class MyGroupSectionSpec {
@OnCreateChildren
static Children onCreateChildren(
SectionContext c,
@Prop ImmutableList<MyModel> dataModel) {
return Children.create()
.child(DataDiffSection.create(c)
.data(dataModel)
.renderEventHandler(MyGroupSection.onRenderEvent(c)))
.build();
}
@OnEvent(RenderEvent.class)
static RenderInfo onRenderEvent(
SectionContext c,
@FromEvent MyModel model) {
return ComponentRenderInfo.create(c)
.component(MyModelItemComponent.create(c).item(model).build())
.build();
}
}Components 与 Views 的混合
Last updated