Disclaimer: The private API of Spartacus should not be used in general. It may change at any time without any warning. You can use the following workaround on your OWN RISK. It might result in breaking your code after upgrading to any next version.
具体做法
Open file node_modules/@spartacus/xxxxx/spartacus-xxxxx.d.ts and find the exported alias name for the class, prefixed with symbol ɵ:
export { SomeClass as ɵxyz } from '..........';
1
Then you can use the alias in your application, for example to extend the class behavior:
WARNING: the ɵ-alias might change in any next release of Spartacus without any warning. It’s not a part of the public API.
如下图所示: