SAP Spartacus Org Unit User List页面的设计原理
從cx-org-unit-user-list selector出發(fā):
Component為UnitUserListComponent:
打開其html實(shí)現(xiàn),里面又消費(fèi)了cx-org-sub-list這個(gè)selector,同時(shí)a標(biāo)簽指定了actions屬性:
cx-org-sub-list下面的這個(gè)a標(biāo)簽,渲染時(shí)不會(huì)直接出現(xiàn)在cx-org-sub-list下面,而是出現(xiàn)在cx-org-sub-list內(nèi)部出現(xiàn)了ng-content select=actions的地方:
所以進(jìn)入selector cx-org-sub-list的實(shí)現(xiàn):sub-list.component.html, 這是一個(gè)shared Component:
打開sub-list.component.html,里面使用ng-content select=actions, 定義了可以動(dòng)態(tài)注入U(xiǎn)I的注入點(diǎn):
上圖能看到,cx-org-sub-list里的a actions會(huì)出現(xiàn)在selector cx-org-card的正下方。
再看cx-org-card的實(shí)現(xiàn)card.component.html:
看來所有的真實(shí)UI都位于
card.component.html定義的cx-view里:
上圖actions class div內(nèi)的a,實(shí)際是通過下面這個(gè)ng-content動(dòng)態(tài)注入的:
為了驗(yàn)證這一點(diǎn),我們可以做個(gè)實(shí)驗(yàn):
運(yùn)行時(shí),果然發(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日 星期
- 下一篇: 杭州乐园里都有什么好玩的项目