【发布时间】:2021-03-23 14:55:40
【问题描述】:
我遇到了一个案例,我应该在电子水疗基地站点中覆盖/扩展 ProductGridItemComponent。
通常,在 Spartacus 中覆盖组件时,可以添加这样的插座模板:
<ng-template cxOutletRef="ProductGridItemComponent">
My custom code here
</ng-template>
但这似乎没有任何效果。如果我尝试覆盖 ProductListComponent 是有效的,但是我将不得不从源代码中复制大量代码以使其行为并看起来像 Spartacus 提供的代码。
是否可以仅覆盖 ProductGridItemComponent 或者我必须覆盖 ProductListComponent 并从头开始构建它?
-- 编辑--
我在另一个帖子上找到了答案。 How to customize lower level components in Spartacus?
ProductGridItemComponent 不可自定义。它必须在更高的层次上完成,ProductListComponent。
【问题讨论】: