The models that are most frequently customized are currently placed in @spartacus/core.
The following is an example of module augmentation on
the ConsentTemplate model:
假设我想扩展Spartacus core里的标准interface:
ConsentTemplate
首先从Spartacus core里导入:
import { ActiveCartService, CartAddEntrySuccessEvent, CmsConfig, Config, ConfigModule, ConsentTemplate, EventService } from '@spartacus/core';
然后使用如下语法扩展一个新的字段documentUrl:
最后的效果:
而关于SAP Spartacus 前台控制逻辑即业务的扩展,示意图如下: