­

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發起請求進行載入: