关于sap:SAP-Spartacus-B2B-列表页面的-i-icon-popover-Component-的声明位置

1次阅读

共计 580 个字符,预计需要花费 2 分钟才能阅读完成。

SAP Spartacus B2B 页面的列表页面,一共有 6 个相似 SAP Fiori Language 里的 tile(磁贴):

点击去之后,能看到列表页面有一个绿色 icon 图标,点击之后,弹出一个 Popover Component:

第一个疑难就是:咱们须要在 6 个 不同的 tile 对应的列表页面里,反复定义 6 次 这个 Popover Component 么?

答案是否定的。咱们并没有在 Spartacus 规范代码里,发现相似 User List Component,这提醒咱们,无论 User List,还是 Org List,很可能是重用某一个 Spartacus 共享控件,只是在运行时,动静注入了一些 tile specific 个性。

咱们这个猜测,从运行时渲染出的 HTML 代码里失去了印证:User List 的页面,应用的 Component selector 为 cx-org-list, class 为 orgUser:

而 Org Unit List,应用的同样是 cx-org-list,区别是 class 为 orgUnit:

selector cx-org-list 对应的 Angular Component 的 template 实现为:list.component.html:

(i) icon 及点击之后弹出的 Popover Component 的布局和逻辑,就写在这个 HTML 文件里,且只实现一次:

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

正文完
 0