Skip to content

Commit

Permalink
fix(upload): uploadPastedFiles =false 时第一次上传文件后会报错,导致整个vue 响应式丢失 (Ten…
Browse files Browse the repository at this point in the history
…cent#3308)

* fix(TimePicker): fixed only support hh:mm format

* fix(TimePicker): disabled position only is  start

* fix(Upload): fixed vue error on uploadPastedFiles is false
  • Loading branch information
myronliu347 authored Sep 6, 2024
1 parent d620299 commit b30b2ab
Showing 1 changed file with 8 additions and 2 deletions.
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

0 comments on commit b30b2ab

Please sign in to comment.