SAPUI5 - 在多个应用程序中重用片段 [英] SAPUI5 - reuse fragments across multiple applications
问题描述
我想知道是否/如何在应用程序 2 中重用在应用程序 1 中创建的片段定义?
I was wondering if/how I can reuse a fragment definition created in application 1 within application 2?
背景:我有 4 个应用程序(由于技术原因需要 4 个独立的 fiori 应用程序)显示类似的数据.
Background: I have 4 application (due to technical reasons there need to be 4 standalone fiori applications) displaying similar data.
我的方法是创建片段并在所有 4 个应用程序中重用它们.
My approach would have been to create fragments and reuse them across all 4 applications.
但是我如何从另一个应用程序加载片段?
But how can I load fragments from another application?
我发现的大多数东西要么仅限于相对路径,要么仅限于 JavaScript 模块......
Most stuff I've found either is limited to relative paths or JavaScript modules....
推荐答案
深入挖掘后,我注意到我可以使用
After digging a little further, I noticed that I can register the desired module path using
jQuery.sap.registerModulePath("name.space", "/sap/bc/ui5_ui5/sap/bsp_name");
- 之后 name.space 在 XML 视图中可用,可用于加载片段.
- 虽然没有加载 i18n,但我可以处理.
这篇关于SAPUI5 - 在多个应用程序中重用片段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!