如何在后台加载sapui5资源
在我们的应用程序中,我们加载了许多SAPUI5库。 html有以下代码来加载SAPUI5资源如何在后台加载sapui5资源,sapui5,Sapui5,在我们的应用程序中,我们加载了许多SAPUI5库。 html有以下代码来加载SAPUI5资源 在我们的web.xml中,我们提到了com.sap.ui5.resource.REMOTE_位置来加载资源 我们观察到,第一次加载应用程序需要很长时间。网络调用表明加载UI5资源需要最长的时间。 我们有没有办法更快地加载UI5资源?还是在后台? 这里的建议或代码示例将非常有用。谢谢 您可以加载UI5资源。使用sap ui preload=“async”数据 但必须使用attachInitEve
在我们的web.xml中,我们提到了com.sap.ui5.resource.REMOTE_位置来加载资源
我们观察到,第一次加载应用程序需要很长时间。网络调用表明加载UI5资源需要最长的时间。
我们有没有办法更快地加载UI5资源?还是在后台?
这里的建议或代码示例将非常有用。谢谢 您可以加载UI5资源。使用sap ui preload=“async”数据
但必须使用attachInitEvent
方法延迟对SAPUI5API的访问
var-oCore=sap.ui.getCore();
oCore.attachInit(函数(){
//做需要的事
});
您试图一次加载太多内容:sap.ui.commons、sap.ui.table、sap.ui.ux3、sap.m
尝试以异步方法仅加载基本部分和其余部分,以便用户在等待太久之前至少可以看到一些操作:
同步
<script src="resources/sap-ui-cachebuster/sap-ui-core.js" id="sap-ui-bootstrap"
data-sap-ui-libs="sap.ui.commons,sap.m"
data-sap-ui-theme="sap_bluecrystal"
data-sap-ui-appCacheBuster="./">
异步
<script src="resources/sap-ui-cachebuster/sap-ui-core.js" id="sap-ui-bootstrap"
data-sap-ui-libs="sap.ui.table,sap.ui.ux3"
data-sap-ui-theme="sap_bluecrystal"
data-sap-ui-preload="async"
data-sap-ui-appCacheBuster="./">
我可以问一下基于
component.js的应用程序
,如何更改async