当前位置:网站首页>How SAP ui5 uses manifest JSON file defines third-party library dependencies

How SAP ui5 uses manifest JSON file defines third-party library dependencies

2022-06-12 23:43:00 Hua Weiyun

Jerry Previous post How to be in SAP UI5 Third party libraries are integrated into applications : One view on a mobile device Web Apply the tips of printing debugging information Introduced a kind of SAP UI5 Tips for defining and using third party libraries .

after , In my technical communication group ,SAP Expert Guo Ye feedback said , There's another way to do it SAP UI5 manifest.json How to define dependencies in the file .



This paper introduces the second method . stay SAP UI5 In Engineering , Create a new one lib Folder , Put in the third party library file , And then in manifest.json Of documents sap.ui5 In the area , Define the reference to this third-party library file .

Source code :

"resources":{		"js": [ {				"uri": "lib/vconsole-min.js",				"name": "vconsole-min.js",				"version": "3.7.0"			}]	}

Runtime ,vConsole The library was loaded successfully .

Of course , stay SAP UI5 The controller uses the following statement to load the third-party library manually , Can also work :

jQuery.sap.require(“SAPUI5ExternalLibs/libs/moment”);

The third-party library loaded in this way , It's the greedy way to load , namely SAP UI5 When the application is initialized , The third-party library will be loaded . and Jerry Previous post How to be in SAP UI5 Third party libraries are integrated into applications : One view on a mobile device Web Apply the tips of printing debugging information The loading mode introduced is lazy loading mode , That is to say, only the controller and the view corresponding to the controller that really use the third-party library function are used by the user , It really triggers the loading of the third-party library .

原网站

版权声明
本文为[Hua Weiyun]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/163/202206122339217545.html