SAP Spartacus Table cell显示数据类型的Component决定逻辑

以SAP Spartacus B2B org unit list为例,table cell到底用什么样的Component来显示数据,取决于units.config.ts文件里定义的配置数据unitsTableConfig:


SAP Spartacus Table cell显示数据类型的Component决定逻辑

如果我将name column的dataComponent改成CellComponent,则最后使用一般的CellComponent来显示数据,不再含有Expand / Collapse功能:


SAP Spartacus Table cell显示数据类型的Component决定逻辑


SAP Spartacus Table cell显示数据类型的Component决定逻辑


而如果一个Component没有显式定义selector,


SAP Spartacus Table cell显示数据类型的Component决定逻辑


最后渲染出来的内容里,Angular会使用默认的selector:ng-component, 这是Angular内部使用的一个selector:

SAP Spartacus Table cell显示数据类型的Component决定逻辑

上一篇:万能脚本录制器(支持鼠标/键盘的前台和后台,支持多种绑定模式)


下一篇:C++ 中命名空间的 5 个常见用法