标签: ui5-tooling

如何将ES模块导入UI5控制器

给定一个 ES 模块dictionaryAPI.mjs

\n
export const DICTIONARY_API = Object.freeze({\n    someKey: "someValue"\n});\n
Run Code Online (Sandbox Code Playgroud)\n

我想将其导入到我的 UI5 控制器中。据我了解,UI5 不支持.mjs扩展,因此我已将扩展名从 更改.mjs.js. 然后,我尝试将其添加到 UI5 控制器中,准确地说,添加到实用程序控制器中ControllerUtilities.js

\n
sap.ui.define([\n    "com/myApp/dictionaryAPI"\n    ],\n    (dictionaryAPI) => ({\xe2\x80\xa6}));\n
Run Code Online (Sandbox Code Playgroud)\n

当我运行该应用程序时,出现错误:

\n
\'com/myApp/controller/ControllerUtilities.js\': Unexpected token \'export\'\n\nsap-ui-core.js:53 Uncaught (in promise) ModuleError: Failed to resolve dependencies of \'com/myApp/controller/Login.controller.js\'\n -> \'com/myApp/controller/BaseController.js\'\n  -> \'com/myApp/controller/ControllerUtilities.js\': Unexpected token \'export\'\n    at p1 (https://openui5nightly.hana.ondemand.com/resources/sap-ui-core.js:53:213)\n    at j1.failWith (https://openui5nightly.hana.ondemand.com/resources/sap-ui-core.js:40:43)\n    at https://openui5nightly.hana.ondemand.com/resources/sap-ui-core.js:65:1556\nCaused by: SyntaxError: Unexpected token \'export\'\n
Run Code Online (Sandbox Code Playgroud)\n

看起来,UI5 无法识别exportES 模块中的 …

javascript sapui5 ui5-tooling

3
推荐指数
1
解决办法
1777
查看次数

Component-preload.js生成

我们即将关闭SAPUI5应用程序,最后一步是制作Component-Preload.js文件以提高性能.我在网上阅读了不同的指南,所有这些指南都需要我安装的Node.js.我不是那个包的专家,我无法想象如何使其中一个指南工作.我正在使用NetBeans进行开发.据我所知,没有官方工具(我是对的吗?)来生成该文件.有比我更多经验的人能否提出一份有效的,解释良好的指南来执行该任务?

我不知道这是否有帮助,那是我的工作树: 当前项目的工作树

sapui5 ui5-tooling

1
推荐指数
1
解决办法
2770
查看次数

Translation does not show non-ASCII characters correctly

I have a SAPUI5 application. The translated text is shown wrongly in a dialog, while the translation is shown correct in the launchpad. Please see the following picture:

在此处输入图片说明

While the translation file is loaded for German language, it does not show [ÖÄÜß] correctly in the dialog. However it doesshows ö correctly in the launchpad page.

How can I solve it?

sapui5 ui5-tooling

1
推荐指数
1
解决办法
72
查看次数

标签 统计

sapui5 ×3

ui5-tooling ×3

javascript ×1