SAP Spartacus Org Unit User List页面的设计原理
從cx-org-unit-user-list selector出發(fā):
Component為UnitUserListComponent:
打開其html實現(xiàn),里面又消費了cx-org-sub-list這個selector,同時a標(biāo)簽指定了actions屬性:
cx-org-sub-list下面的這個a標(biāo)簽,渲染時不會直接出現(xiàn)在cx-org-sub-list下面,而是出現(xiàn)在cx-org-sub-list內(nèi)部出現(xiàn)了ng-content select=actions的地方:
所以進入selector cx-org-sub-list的實現(xiàn):sub-list.component.html, 這是一個shared Component:
打開sub-list.component.html,里面使用ng-content select=actions, 定義了可以動態(tài)注入UI的注入點:
上圖能看到,cx-org-sub-list里的a actions會出現(xiàn)在selector cx-org-card的正下方。
再看cx-org-card的實現(xiàn)card.component.html:
看來所有的真實UI都位于
card.component.html定義的cx-view里:
上圖actions class div內(nèi)的a,實際是通過下面這個ng-content動態(tài)注入的:
為了驗證這一點,我們可以做個實驗:
運行時,果然發(fā)現(xiàn)create a標(biāo)簽頁出現(xiàn)在擁有fairy class的div下面:
因此,最后處理issue,精力應(yīng)集中在sub-list.component.html中的cx-table:
更多Jerry的原創(chuàng)文章,盡在:“汪子熙”:
總結(jié)
以上是生活随笔為你收集整理的SAP Spartacus Org Unit User List页面的设计原理的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 我的工作日志 2020年12月1日 星期
- 下一篇: SAP Spartacus 重用组件cx