如何覆盖特定的斯巴达克斯组件
我在斯巴达克斯两次使用相同的组件,但使用不同的数据。
我正在尝试覆盖此组件,但是如果我用类型代码覆盖它,它们都将相同,而我仍然需要它们不同。
有没有一种方法可以使用特定的ID来定位组件的特定实例而不是覆盖所有组件?
I am using the same component twice in Spartacus but with different data.
I am trying to override this component but if I override it with the type code they will both be identical while I need them to still be different.
Is there a way to use a specific id to target a specific instance of the component instead of overriding all of them ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在您的情况下,由于两个组件是相同的,但具有不同的数据,因此我认为数据将作为输入。
在这种情况下,我建议在app.component.html文件中使用插座。例如:
In this case, they would be rendered in their respective sections but with different data. Does this answer your question?
In your case, since the two components are the same but have different data, I assume the data would come as input.
In this case, I would suggest using outlets in the app.component.html file. For example:
In this case, they would be rendered in their respective sections but with different data. Does this answer your question?