当前位置:网站首页>SAP UI5 如何通过 manifest.json 文件定义第三方库依赖关系
SAP UI5 如何通过 manifest.json 文件定义第三方库依赖关系
2022-06-12 23:39:00 【华为云】
Jerry 之前的文章 如何在 SAP UI5 应用中集成第三方库 :一个在移动设备上查看 Web 应用打印调试信息的小技巧 介绍了一种 SAP UI5 定义并使用第三方库的技巧。
之后,我的技术交流群里,SAP 专家郭爷反馈说,还有另一种在 SAP UI5 manifest.json 文件里定义依赖的办法。



本文即介绍第二种办法。在 SAP UI5 工程里,新建一个 lib 文件夹,把第三方库文件放进去,然后在 manifest.json 文件的 sap.ui5 区域里,定义这个第三方库文件的引用。

源代码:
"resources":{ "js": [ { "uri": "lib/vconsole-min.js", "name": "vconsole-min.js", "version": "3.7.0" }] }运行时,vConsole 库被成功加载。

当然,在 SAP UI5 控制器里手动采用下列语句加载第三方库,也能工作:
jQuery.sap.require(“SAPUI5ExternalLibs/libs/moment”);
本文这种方式加载的第三方库,是采取的贪婪加载方式,即 SAP UI5 应用初始化的时候,就会加载第三方库。而 Jerry 之前的文章 如何在 SAP UI5 应用中集成第三方库 :一个在移动设备上查看 Web 应用打印调试信息的小技巧 介绍的加载方式是懒加载方式,即只有真正使用到第三方库功能的控制器和控制器对应的视图被用户使用到时,才真正触发第三方库的加载。
边栏推荐
- MySQL基础篇视图的总结
- So, what is the difference between e.target and e.currenttarget?
- It is meaningful to define genus, and D can use it to explain semantics
- The programmer has worked for 7 years. At the age of 31, he has no choice but to deliver takeout. I really don't want you to go through his journey again
- CS for mobile security [nethunter]
- Ast, really fragrant
- Message queue directory
- Find out the data that can match the keyword key in field 1 or field 2 in the database table. If you want to display the matching data in field 1 first
- 移动安全必备之CS呢【NETHUNTER】
- 人脸检测:MTCNN
猜你喜欢

ShardingSphere-proxy-5.0.0部署之分表实现(一)

LeetCode 146. LRU cache

Teach you how to grab ZigBee packets through cc2531 and parse encrypted ZigBee packets

Leetcode 2164. 对奇偶下标分别排序(可以,一次过)

Model over fitting - solution (II): dropout

Develop a web office suite from scratch (5): mouse hover over text

2022年G3锅炉水处理考题模拟考试平台操作

2022起重机械指挥上岗证题目模拟考试平台操作

Shardingsphere-proxy-5.0.0 deployment table implementation (I)

2022年危险化学品经营单位安全管理人员考试试题及在线模拟考试
随机推荐
Theory + practice will help you master the dynamic programming method
Colab tutorial (super detailed version) and colab pro/colab pro+ usage evaluation
[literature translation - Part] revealing the structure of clinical EEG signals by self supervised learning (SSL and RP principles / data / preprocessing)
InfoQ 极客传媒 15 周年庆征文|简述构建微服务架构的四大挑战
Redis实现短信验证码登录
线上真实排队系统重构案例分享——实战篇
[opencv learning] use the Tesseract OCR movement to recognize numbers
移动安全必备之CS呢【NETHUNTER】
Record 5 - the serial port of stm32f411ceu6 realizes the sending and receiving of fixed length data and variable length data
[issue 30] shopee golang development experience
Leetcode 890 finding and replacing patterns [map] the leetcode path of heroding
Model over fitting - solution (II): dropout
About three-tier architecture and MVC
The carrying capacity of L2 level ADAS increased by more than 60% year-on-year in January, and domestic suppliers "emerged"
Module 8 operation
Novice must see! How rust beginners write gear smart contracts (1)
2022起重机械指挥上岗证题目模拟考试平台操作
2202-简历制作
Embedded pipeline out of the box
cookie