我遵循以下链接
我还添加了JsonStore插件
尝试初始化Cordova Mobile First应用程序时,Wl.jsonStore未初始化
WL.JSONStore.init(collections).then(function (collections) {
alert("collections creted sucessfully");
console.log("Collections created sucessfully");
// handle success - collection.people (people's collection)
}).fail(function
(error) {
alert(error);
console.log(error);// handle failure });
WL.Store需要初始化。 Kinldy帮我解决这个问题。
最后,我在IBM TroubleShoot站点找到了答案
请参阅链接:
https://mobilefirstplatform.ibmcloud.com/tutorials/ru/foundation/8.0/troubleshooting/jsonstore/
在config.xml中,将clientCustomInit属性更改为true。在index.js文件中:在文件的开头添加以下行:
document.addEventListener('mfpjsonjsloaded', initWL, false);
在wlCommonInit()中保留WL.JSONStore.init调用
添加以下功能:
function initWL(){
var options = typeof wlInitOptions !== 'undefined' ? wlInitOptions
: {};
WL.Client.init(options);
}