![](https://img.laitimes.com/img/__Qf2AjLwojIjJCLyojI0JCLicmbw5SOkFjZ4YTOzIjY1UGMkNGOwQmM0M2YwgzNyIjZiFTYi9CX5d2bs92Yl1iclB3bsVmdlR2LcNWaw9CXt92Yu4GZjlGbh5yYjV3Lc9CX6MHc0RHaiojIsJye.png)
Every CMS component implemented in spartacus should be recognized by Smart Edit thanks to the generic smart-edit contract (based on special html attributes implemented in Spartacus). 这个链接能看到contract的更多明细。
It’s implemented inside Spartacus cxComponentWrapper directive, which maps CMS component names into live Angular components. See code:
https://github.com/SAP/spartacus/blob/develop/projects/storefrontlib/src/cms-structure/page/component/component-wrapper.directive.ts#L92-L99private decorate(elementRef: ElementRef): void {
this.dynamicAttributeService.addDynamicAttributes(
elementRef.nativeElement,
this.renderer,
{ componentData: this.cxComponentWrapper }