How does jQuery.sap.require work?

前端 未结 4 1645
囚心锁ツ
囚心锁ツ 2021-01-07 11:22

Does SAPUI5 load the libraries each time I call jQuery.sap.require(\"someLibrary\")? For instance if I am calling the above statement in multiple modules in my

4条回答
  •  鱼传尺愫
    2021-01-07 11:58

    The lib is only loaded once. You can find this information in the SDK https://sapui5.hana.ondemand.com/sdk/#docs/guide/ModularizationConcept.html

    Module Loading

    As mentioned already, modules are loaded by calling function jQuery.sap.require with the name of a required module. The framework then checks whether the named module is loaded already. If so, the function simply returns. Otherwise it tries to load and execute the module synchronously. If any of these two steps fails, an exception is thrown and execution of the calling module thereby is disrupted.

提交回复
热议问题