Closed qq329401134 closed 4 years ago
在Page中正常使用
class DongTaiDetailPage extends Page<DongTaiDetailPage , Map<String, dynamic>> {
DongTaiDetailPage ()
: super(
initState: initState,
effect: buildEffect(),
reducer: buildReducer(),
view: buildView,
dependencies: Dependencies
父:是动态list下的一个动态组件 class DongTaiComponent extends Component
with PrivateReducerMixin {
DongTaiComponent()
: super(
view: buildView,
effect: buildEffect(),
reducer: buildReducer(),
dependencies: Dependencies(
slots: <String, Dependent>{
'toupiao': ToupiaoComponentConnector() + ToupiaoComponent(),
}),
);
}
class ToupiaoComponentConnector
extends ConnOp<DongTaiComponentState, ToupiaoComponentState>
with ReselectMixin<DongTaiComponentState, ToupiaoComponentState> {
@override
ToupiaoComponentState computed(DongTaiComponentState state) {
return ToupiaoComponentState()
..voteItemInfo = state.voteItemInfo
..submitLoading = state.submitLoading
..voteTitle = state.voteTitle;
}
@override List factors(DongTaiComponentState state) {
return [state.voteItemInfo];
}
@override void set(DongTaiComponentState state, ToupiaoComponentState subState) { state.voteItemInfo = List.from(subState.voteItemInfo); state.submitLoading = subState.submitLoading; state.voteTitle = subState.voteTitle; } }
子是动态组件中的一个投票组件 class ToupiaoComponent extends Component
with PrivateReducerMixin {
ToupiaoComponent()
: super(
view: buildView,
effect: buildEffect(),
reducer: buildReducer(),
);
}
在投票组件中的reducer里面打断点断不下来,但是effect可以