SAP Spartacus 的页面设计思路
CMS提供了page structure,但不提供clear layout definition.
所謂CMS page structure,即CMS只提供了一個有序清單,包含了slots和Component信息。Slots自身,并沒有包含應該如何在layout里渲染的元數據。
所以,SAP Spartacus視圖邏輯里的layout信息,通過LayoutConfig配置對象定義。
Spartacus不區分page template和page section.
在LayoutConfig里,slots通過順序進行配置。
我在SAP Spartacus處于運行狀態(即ng serve)始終處于運行狀態時,進行代碼熱修改,經常遇到此類錯誤消息
退出ng serve,重新執行即可:
Storefront.component.html里包含了整個Storefront layout的框架:
page-layout.component.html里,用async將slots$展開,再用cx-page-slot將頁面展示出來:
slot值:SiteLogo
page-slot.component.html:
上圖的 Section2A,Section2B,Section2C,都是 LandingPage2Template 的 slots,定義在文件 projects\storefrontlib\src\recipes\config\layout-config.ts 里面。
更多Jerry的原創文章,盡在:“汪子熙”:
總結
以上是生活随笔為你收集整理的SAP Spartacus 的页面设计思路的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 发生异常io错误0xc00000e9怎么
- 下一篇: SAP Spartacus的User明细