SAP Spartacus B2B 页面 Disable 按钮的显示原理
SAP Spartacus B2B 頁面 disable 按鈕如下圖所示。
這個高亮的 disable 按鈕,和左邊相鄰的 Edit 按鈕,實現位于不同的 Component.
disable 按鈕有單獨的實現 Component:toggle-status.component.ts, selector: cx-org-toggle-status
在 B2B Launchpad 6 個 tile 里都消費了該 Component,以 unit 頁面為例,消費代碼如下:
<cx-org-toggle-statusactionskey="uid"i18nRoot="orgUnit"></cx-org-toggle-status>其中 18 行的 key,19 行的 i18nRoot, 都是為了給該 Component 的 @input 屬性傳遞輸入值:
而 17 行的屬性 actions,我們試著把這個值改一改,看會發生什么:
不出所料,Disable 按鈕從工具欄里消失了:
根據關鍵字 select="[actions]" 搜索,能發現 card.component.html 模板實現里,通過 ng-content 實現了動態內容注入,注入條件是那些包含了 actions 屬性的標簽。
所以,包含了 Disable 按鈕的 Component,其屬性值必須是 actions,只有這樣,才能被動態注入到 card.component.html 的 header 區域去。
更多Jerry的原創文章,盡在:“汪子熙”:
總結
以上是生活随笔為你收集整理的SAP Spartacus B2B 页面 Disable 按钮的显示原理的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: linux clk时钟源管理
- 下一篇: CAD怎么批量导出数据?cad导出少量数