SAP Spartacus 标准类型的字段扩展 - type augmentation
生活随笔
收集整理的這篇文章主要介紹了
SAP Spartacus 标准类型的字段扩展 - type augmentation
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
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:
declare module '@spartacus/core' {interface ConsentTemplate {documentUrl?: string;} }最后的效果:
而關于SAP Spartacus 前臺控制邏輯即業(yè)務的擴展,示意圖如下:
更多Jerry的原創(chuàng)文章,盡在:“汪子熙”:
總結
以上是生活随笔為你收集整理的SAP Spartacus 标准类型的字段扩展 - type augmentation的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 使用 flex布局 制作携程网首页
- 下一篇: SAP Spartacus Layout