Skip to content

Commit

Permalink
fix(upload): uploadPastedFiles =false 时第一次上传文件后会报错,导致整个vue 响应式丢失 (#3308)
Browse files Browse the repository at this point in the history
* 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 and uyarn committed Sep 24, 2024
1 parent e69ad07 commit 0dd7d07
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
8 changes: 7 additions & 1 deletion src/upload/upload.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,17 @@ export default defineComponent({
toUploadFiles.value = files;
uploadData.uploadFiles();
};
const handlePasteFileChange = (e: ClipboardEvent) => {
if (props.uploadPastedFiles) {
onPasteFileChange(e);
}
};

return {
...uploadData,
onUploadPaste,
onPasteFileChange,
handlePasteFileChange,
commonDisplayFileProps,
dragProps,
uploadClasses,
Expand Down Expand Up @@ -264,7 +270,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
10 changes: 5 additions & 5 deletions test/snap/__snapshots__/csr.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -28982,7 +28982,7 @@ exports[`csr snapshot test > csr test ./src/color-picker/_example/panel.vue 1`]
>
<div
class="t-color-picker__saturation"
style="background: rgb(0, 96, 255);"
style="background: rgb(0, 0, 0);"
>
<span
class="t-color-picker__thumb"
Expand Down Expand Up @@ -29784,7 +29784,7 @@ exports[`csr snapshot test > csr test ./src/color-picker/_example/panel.vue 1`]
</div>
<div
class="t-color-picker__saturation"
style="background: rgb(0, 136, 255);"
style="background: rgb(0, 0, 0);"
>
<span
class="t-color-picker__thumb"
Expand Down Expand Up @@ -32287,7 +32287,7 @@ exports[`csr snapshot test > csr test ./src/color-picker/_example/status-readonl
>
<div
class="t-color-picker__saturation"
style="background: rgb(0, 96, 255);"
style="background: rgb(0, 0, 0);"
>
<span
class="t-color-picker__thumb"
Expand Down Expand Up @@ -33098,7 +33098,7 @@ exports[`csr snapshot test > csr test ./src/color-picker/_example/swatch-color.v
>
<div
class="t-color-picker__saturation"
style="background: rgb(0, 96, 255);"
style="background: rgb(0, 0, 0);"
>
<span
class="t-color-picker__thumb"
Expand Down Expand Up @@ -33477,7 +33477,7 @@ exports[`csr snapshot test > csr test ./src/color-picker/_example/swatch-color.v
>
<div
class="t-color-picker__saturation"
style="background: rgb(0, 96, 255);"
style="background: rgb(0, 0, 0);"
>
<span
class="t-color-picker__thumb"
Expand Down

0 comments on commit 0dd7d07

Please sign in to comment.