Skip to content

Commit b43e79f

Browse files
committed
doc: update demo
1 parent 340cc76 commit b43e79f

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

demo/index.ts

+3-4
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,19 @@ document.body.appendChild(container);
1313
input.onchange = async (): Promise<void> => {
1414
try {
1515
console.time("compress");
16-
1716
if (!input.files) return;
1817
const blobs = await compress(input.files, { useWebp: false });
1918
console.timeEnd("compress");
2019
// 显示成功
21-
document.body.append("压缩成功");
20+
container.append("compress success");
2221
// 下载 blob
2322
for (let i = 0; i < blobs.length; i++) {
2423
const blob = blobs[i];
2524
const url = URL.createObjectURL(blob);
2625
const a = document.createElement("a");
2726
a.href = url;
28-
a.download = `compressed-${i}.${blob.type.split("/")[1]}`;
29-
a.textContent = `下载-${i + 1}`;
27+
a.download = `compressed-${i + 1}.${blob.type.split("/")[1]}`;
28+
a.textContent = `download-${i + 1}`;
3029
container.appendChild(a);
3130
}
3231
} catch (error) {

0 commit comments

Comments
 (0)