Split App.vue

This commit is contained in:
MengYX
2020-02-06 16:01:35 +08:00
parent e3ca175258
commit 3ee9f5d2d1
5 changed files with 263 additions and 215 deletions

26
src/component/util.js Normal file
View File

@@ -0,0 +1,26 @@
export function DownloadBlobMusic(data, format) {
const a = document.createElement('a');
a.href = data.file;
switch (format) {
case "1":
a.download = data.title + "." + data.ext;
break;
case "2":
a.download = data.artist + " - " + data.title + "." + data.ext;
break;
case "3":
a.download = data.title + " - " + data.artist + "." + data.ext;
break;
default:
a.download = data.filename;
break;
}
document.body.append(a);
a.click();
a.remove();
}
export function RemoveBlobMusic(data) {
URL.revokeObjectURL(data.file);
URL.revokeObjectURL(data.picture);
}