SAP Spartacus 的頁面設計思路

2021-10-10 09:18:02 字數 1442 閱讀 3026

cms提供了page structure,但不提供clear layout definition.

所謂cms page structure,即cms只提供了乙個有序清單,包含了slots和component資訊。slots自身,並沒有包含應該如何在layout裡渲染的元資料。

所以,sap spartacus檢視邏輯裡的layout資訊,通過layoutconfig配置物件定義。

在layoutconfig裡,slots通過順序進行配置。

我在sap spartacus處於執行狀態(即ng serve)始終處於執行狀態時,進行**熱修改,經常遇到此類錯誤訊息

退出ng serve,重新執行即可:

storefront.component.html裡包含了整個storefront layout的框架:

page-layout.component.html裡,用async將slots$展開,再用cx-page-slot將頁面展示出來:

slot值:sitelogo

上圖的 section2a,section2b,section2c,都是 landingpage2template 的 slots,定義在檔案 projects\storefrontlib\src\recipes\config\layout-config.ts 裡面。

更多jerry的原創文章,盡在:「汪子熙」:

SAP Spartacus的自定義路由

我新建了乙個自定義component import from angular core import from product name normalizer component export class custompagecomponent implements oninit ngoninit ...

使用thymeleaf做頁面渲染時的頁面快取

現在動靜分離很多,靜態頁面幾乎都還存在瀏覽器,這裡說的是用thymeleaf渲染前台資料時,後台直接把整個html頁面 快取到redis中,請求直接返回整個頁面 springwebcontext ctx new springwebcontext request,response,html thyme...

Web頁面設計之頁面框架的使用

web頁面設計之頁面框架的使用 web頁面設計之頁面框架的使用,web,框架,frameset,frame,iframe,框架是頁面設計中不可缺少的元素之一,本文詳細介紹了html語言中頁面框架的實現方法,對於其各個屬性,給與了詳細的介紹並且給出使用例項。相信在閱讀本文之後會使您對使用框架規劃頁面有...