在 Spartacus.4 中,将产品轮播中的 "items per slide" 配置从每张幻灯片 4 个项目更改为每张幻灯片 3 个项目的正确方法是什么
What is the correct way to change the "items per slide" configuration in product carousel from 4 items per slide to 3 items per slide in Spartacus.4
我试过了 -
export class CustomProductCarouselComponent extends ProductCarouselComponent {
constructor(
componentData: CmsComponentData<model>,
productService: ProductService
) {
super(componentData, productService);
}
getProduct(code: string): Observable<Product> {
return this.productService.get(code);
}
}
但是Html模板给出类型错误。 see screenshot for the same.
您可以在集成轮播标签的 html 模板中设置属性 itemWidth
<cx-carousel ... itemWidth="33%"...>
我试过了 -
export class CustomProductCarouselComponent extends ProductCarouselComponent {
constructor(
componentData: CmsComponentData<model>,
productService: ProductService
) {
super(componentData, productService);
}
getProduct(code: string): Observable<Product> {
return this.productService.get(code);
}
}
但是Html模板给出类型错误。 see screenshot for the same.
您可以在集成轮播标签的 html 模板中设置属性 itemWidth
<cx-carousel ... itemWidth="33%"...>