Skip to content

Commit 3cb8532

Browse files
authored
fix: wrong JavaScript example in upload plugin (#2861)
1 parent 92bddf1 commit 3cb8532

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/content/docs/zh-cn/plugin/upload.mdx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ import { upload } from '@tauri-apps/plugin-upload';
7979
upload(
8080
'https://example.com/file-upload',
8181
'./path/to/my/file.txt',
82-
(progress, total) => console.log(`Uploaded ${progress} of ${total} bytes`), // 上传进度时调用的回调函数
82+
({ progress, total }) =>
83+
console.log(`Uploaded ${progress} of ${total} bytes`), // 上传进度时调用的回调函数
8384
{ 'Content-Type': 'text/plain' } // 与请求一起发送的可选头信息
8485
);
8586
```
@@ -90,7 +91,8 @@ import { download } from '@tauri-apps/plugin-upload';
9091
download(
9192
'https://example.com/file-download-link',
9293
'./path/to/save/my/file.txt',
93-
(progress, total) => console.log(`Downloaded ${progress} of ${total} bytes`), // 下载进度时调用的回调函数
94+
({ progress, total }) =>
95+
console.log(`Downloaded ${progress} of ${total} bytes`), // 下载进度时调用的回调函数
9496
{ 'Content-Type': 'text/plain' } // 与请求一起发送的可选头信息
9597
);
9698
```

0 commit comments

Comments
 (0)