let unload = { elem: '.fairy-sku-img', bindAction: '#id-upload-skus', auto: false, url: this.options.uploadUrl, exts: 'png|jpg|ico|jpeg|gif', accept: 'images', acceptMime: 'image/*', multiple: true, data: { "form": "商品图片", "module": "商品图片 ", "tagName": "商品图片", "flow": "商品图片" }, choose: function (obj) { }, done: function (res, index, upload) { }, allDone: function (obj) { // 多文件上传完毕后的状态回调 } }; if (this.data.upload) { this.data.upload.reload(unload); } else { this.data.upload = upload.render(unload); }重载后选择文件无反应
时间: 2024-02-10 10:35:28 浏览: 93
根据你提供的代码,我看到你使用的是 layui 的上传组件,你的代码中给出的上传组件配置看起来没有问题。
根据你的描述,重载后选择文件无反应,可能有以下几种原因:
1. 组件未正确加载:请确保上传组件已正确加载。可以在控制台中查看是否存在任何错误,或者在 `choose` 函数中添加 `console.log` 等语句,看看是否有输出。
2. 组件参数设置有误:请检查组件的参数设置是否正确。比如 `elem` 是否指定了正确的元素,`bindAction` 是否正确绑定了上传按钮等。
3. 浏览器问题:有时候浏览器可能会禁用上传文件功能,可以尝试清除浏览器缓存或者更换浏览器。
如果以上方法都无法解决问题,建议你提供更多详细信息,这样我才能更好地帮助你。
相关问题
let unload = upload.render({ elem: '.fairy-sku-img', bindAction: '#id-upload-skus', auto: false, url: this.options.uploadUrl, exts: 'png|jpg|ico|jpeg|gif', accept: 'images', acceptMime: 'image/*', multiple: true, data: { "form": "商品图片", "module": "商品图片 ", "tagName": "商品图片", "flow": "商品图片" }, choose: function (obj) { }, done: function (res, index, upload) { }, allDone: function (obj) { // 多文件上传完毕后的状态回调 } }; if (this.data.upload) { this.data.upload.reload(unload); } else { this.data.upload = upload.render(unload); })。怎么重载整个实例
要重载整个实例,您可以使用 `reload` 方法来重新加载上传组件的参数。
代码示例:
```javascript
if (this.data.upload) {
this.data.upload.reload(unload);
} else {
this.data.upload = upload.render(unload);
}
```
在这个示例中,如果 `upload` 存在,则使用 `reload` 方法来重新加载上传组件的参数,否则使用 `upload.render` 方法创建一个新的 `upload` 实例。
this.player.on("statistics_info", function (res) { if (this.lastDecodedFrame == 0) { this.lastDecodedFrame = res.decodedFrames; return; } if (this.lastDecodedFrame != res.decodedFrames) { this.lastDecodedFrame = res.decodedFrames; } else { this.lastDecodedFrame = 0; if (this.player) { this.player.pause(); this.player.unload(); this.player.detachMediaElement(); this.player.destroy(); this.player= null; this.createPlayer(videoElement, this.url); } } });
这是一段 JavaScript 代码,使用了某个播放器(可能是 video.js)的 API。当播放器触发 "statistics_info" 事件时,代码会检查最近解码的帧数(res.decodedFrames)是否与之前的帧数相同。如果不同,代码会更新最近解码的帧数。如果相同,则代码会暂停播放,卸载播放器,删除播放器的媒体元素,销毁播放器并创建一个新的播放器。这段代码可能是为了解决某些播放器问题而编写的。
阅读全文
相关推荐

















