天天看點

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決定邏輯

繼續閱讀