SAP Spartacus 标准类型的字段扩展 - type augmentation
生活随笔
收集整理的這篇文章主要介紹了
SAP Spartacus 标准类型的字段扩展 - type augmentation
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
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:
假設(shè)我想擴(kuò)展Spartacus core里的標(biāo)準(zhǔn)interface:
ConsentTemplate
首先從Spartacus core里導(dǎo)入:
import { ActiveCartService, CartAddEntrySuccessEvent, CmsConfig, Config, ConfigModule, ConsentTemplate, EventService } from '@spartacus/core';然后使用如下語法擴(kuò)展一個(gè)新的字段documentUrl:
declare module '@spartacus/core' {interface ConsentTemplate {documentUrl?: string;} }最后的效果:
而關(guān)于SAP Spartacus 前臺(tái)控制邏輯即業(yè)務(wù)的擴(kuò)展,示意圖如下:
更多Jerry的原創(chuàng)文章,盡在:“汪子熙”:
總結(jié)
以上是生活随笔為你收集整理的SAP Spartacus 标准类型的字段扩展 - type augmentation的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 使用 flex布局 制作携程网首页
- 下一篇: SAP Spartacus Layout