可能我的问题有点愚蠢,因为有很多关于路由的文档。问题是,我不是角度专家,所以我缺少一些上下文。
我想向 spartacus 添加一个自定义子页面 ( http://localhost:4200/image-upload )。页眉和页脚应该相同。只是内容应该是一个上传表单。
在哪里以及如何配置路由?
最佳答案
- 在 CMS 中添加带有页面标签
/image-upload
的新内容页面(带有前导斜杠)。 Spartacus 路由应该处理它 OOTB。 https://sap.github.io/cloud-commerce-spartacus-storefront-docs/adding-and-customizing-routes/ - 仅当您的页面具有自定义布局时才添加布局配置 https://sap.github.io/cloud-commerce-spartacus-storefront-docs/page-layout/#configuring-the-layout
- 实现应出现在此页面上的 Angular CMS 组件,并配置从 CMS 组件类型到实现的映射 https://sap.github.io/cloud-commerce-spartacus-storefront-docs/customizing-cms-components/#page-title
关于spartacus-storefront - 向 Spartacus 添加自定义页面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60167493/