Commit 00c446efff68c39247ca4f0b47d00abd57b4a741
Committed by
GitHub
1 parent
5539190c
fix: 修复导入相同excel文件不发生change事件 (#2356)
Showing
1 changed file
with
6 additions
and
1 deletions
src/components/Excel/src/ImportExcel.vue
@@ -142,9 +142,14 @@ | @@ -142,9 +142,14 @@ | ||
142 | * @description: 触发选择文件管理器 | 142 | * @description: 触发选择文件管理器 |
143 | */ | 143 | */ |
144 | function handleInputClick(e: Event) { | 144 | function handleInputClick(e: Event) { |
145 | - const files = e && (e.target as HTMLInputElement).files; | 145 | + const target = e && (e.target as HTMLInputElement); |
146 | + const files = target?.files; | ||
146 | const rawFile = files && files[0]; // only setting files[0] | 147 | const rawFile = files && files[0]; // only setting files[0] |
148 | + | ||
149 | + target.value = ''; | ||
150 | + | ||
147 | if (!rawFile) return; | 151 | if (!rawFile) return; |
152 | + | ||
148 | if (props.isReturnFile) { | 153 | if (props.isReturnFile) { |
149 | emit('success', rawFile); | 154 | emit('success', rawFile); |
150 | return; | 155 | return; |