【发布时间】:2024-05-01 16:05:02
【问题描述】:
我目前正在使用cordova/phonegap,我已经从'https://www.npmjs.com/package/cordova-plugin-refresh-gallery'安装了refreshgallary插件,但我没有在'window'对象中得到它,它似乎每次都未定义。 在插件 www 文件夹下 pluginRefresgGallary.js 文件代码如下所示(代码已更改):-
cordova.define("Plugins/RefreshGalleryPlugin/", function (require, exports, module) {
var exec = require('cordova/exec');
// Plugin Refresh Gallery - Android
var RefreshMedia = function() {
};
RefreshMedia.prototype.refresh = function(url) {
exec(success, error, "PluginRefreshGallery", "refresh", [url]);
};
var success = function(success){
//alert("Success");
},
error = function(error){
//alert("Error");
};
window.refreshMedia = new RefreshMedia();
module.exports = refreshMedia;
})
在此之前,我收到一个错误,称为模块未定义,我已经定义了类似上面的代码错误已解决,但我没有将 refreshGallry 插件添加到 windows 对象中。
谁能帮我解决这个问题???
【问题讨论】:
标签: cordova phonegap-plugins cordova-plugins cordova-3