SAP UI5 嵌入 manifest.json 正确

SAP UI5 embed manifest.json right

我刚刚为我的 UI5 应用程序编写了描述文件。 现在我有这些问题:

  1. 在哪里以及如何正确地将 manifest.json 嵌入到我的项目中?
  2. 如何测试它是否正常工作? (正确嵌入)
  3. "start_url": "" 是否类似于 index.html 的 initialPage?

非常感谢您的指导, 克里斯

  1. 通常manifest.json 文件(又名 "Application Descriptor")与 where the Component.js file is located. The component will look for the file name "manifest.json" in the same folder. If the descriptor is located somewhere else or has a different file name, assign the relative URL of the file to the manifestUrl in the component factory function like this 放在同一个文件夹中,无论如何都建议这样做,因为它 ...

    • 加载描述符文件before creating the component (same as manifestFirst) allowing us to preload dependencies and model data以缩短初始加载时间。
    • 指定组件 redundantname

      You can either pass the name of the component or the URL of the descriptor file to load [the component] via the descriptor.

  2. 要查看文件是否正确嵌入,运行 应用程序并查看是否

    • rootView 已加载,
    • 模型(例如 i18n 的 ResourceModel)设置为组件实例,
    • 加载分配给 sap.ui5/resources 的自定义资源,等等。
      → 确保包括(或 manifestFirst/manifestUrldon't be tempted to remove) manifest declaration in the component metadata.
  3. "start_url" 纯粹是建议性的,meant for the web standard 而不是 UI5。它告诉浏览器在用户启动网络应用程序时在哪里寻找初始页面。

要了解有关描述符文件的更多信息,请查看开发人员指南,例如 "Descriptor for Applications" or as a summary, here