Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(upload): uploadPastedFiles =false 时第一次上传文件后会报错,导致整个vue 响应式丢失 #3308

Merged
merged 6 commits into from
Sep 6, 2024
Merged
10 changes: 8 additions & 2 deletions src/upload/upload.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,15 @@ export default defineComponent({
},
]);

const handlePasteFileChange = (e: ClipboardEvent) => {
if (props.uploadPastedFiles) {
onPasteFileChange(e);
}
};

return {
...uploadData,
onPasteFileChange,
handlePasteFileChange,
commonDisplayFileProps,
dragProps,
uploadClasses,
Expand Down Expand Up @@ -246,7 +252,7 @@ export default defineComponent({

render() {
return (
<div class={this.uploadClasses} onPaste={this.uploadPastedFiles ? this.onPasteFileChange : undefined}>
<div class={this.uploadClasses} onPaste={this.handlePasteFileChange}>
<input
ref="inputRef"
type="file"
Expand Down
Loading