UI5 Control lazy load mechanism

  • 2019 年 10 月 4 日
  • 筆記

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。

本文链接:https://jerry.blog.csdn.net/article/details/100824299

  • Create dummy constructor which loads the class on demand
  • this is a derived ( generated ) file. Change should be done in the underlying source files only(*.control, *.js) or they will be lost after the next generation.

当UI需要实例化一个js 类的instance时,

首先会call jQuery.sap.require方法去加载该类:

requireModule方法输入的是该类对应的js文件的相对路径:

sScript内容如下:

触发对应的TileBase module的加载:

通过getResourcePath获得module对应的js文件路径,然后通过AJAX想server发起请求进行加载:

Exit mobile version