zl程序教程

您现在的位置是:首页 >  其他

当前栏目

如何替换SAP Spartacus启动Component -app-root

SAPApp 如何 启动 替换 root Spartacus Component
2023-09-14 09:02:54 时间

在SAP Spartacus app.module.ts里,随便定义一个简单的Component:


@Component({
  selector: "app-root",
  template: `
  <h1>Hello</h1>
  
  `
})
export class AppComponent {

}

index.html里,将dummy Component的selector维护进去:

运行时效果:locateHostElement

使用浏览器原生的document.querySelector方法,拿到app-root对应的dom:

更多Jerry的原创文章,尽在:“汪子熙”: