xianniu-ui 0.5.2-beta.3 → 0.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/xianniu-ui.common.js +67 -52
- package/lib/xianniu-ui.umd.js +67 -52
- package/lib/xianniu-ui.umd.min.js +2 -2
- package/package.json +1 -1
- package/packages/upload/main.vue +18 -9
package/package.json
CHANGED
package/packages/upload/main.vue
CHANGED
|
@@ -297,15 +297,24 @@ export default {
|
|
|
297
297
|
this.imageView = file.url;
|
|
298
298
|
});
|
|
299
299
|
},
|
|
300
|
-
async handleDownload(
|
|
301
|
-
const
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
300
|
+
async handleDownload(file) {
|
|
301
|
+
const {url,name} = file
|
|
302
|
+
const x= new XMLHttpRequest()
|
|
303
|
+
x.open('GET',url,true)
|
|
304
|
+
x.responseType = 'blob'
|
|
305
|
+
x.onload = function(){
|
|
306
|
+
const _url = window.URL.createObjectURL(x.response)
|
|
307
|
+
const elt = document.createElement("a");
|
|
308
|
+
elt.setAttribute("href", _url);
|
|
309
|
+
elt.setAttribute("download", name);
|
|
310
|
+
elt.style.display = "none";
|
|
311
|
+
elt.target = "_blank";
|
|
312
|
+
document.body.appendChild(elt);
|
|
313
|
+
elt.click();
|
|
314
|
+
document.body.removeChild(elt);
|
|
315
|
+
}
|
|
316
|
+
x.send()
|
|
317
|
+
|
|
309
318
|
},
|
|
310
319
|
handleRemove(file, fileList) {
|
|
311
320
|
fileList.forEach((item, idx) => {
|