File tree 2 files changed +12
-1
lines changed
packages/vuetify/src/components/VFileInput
2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change 31
31
position : absolute
32
32
top : 0
33
33
width : 100%
34
- z-index : 1
35
34
36
35
.v-input__details
37
36
padding-inline : $file-input-details-padding-inline
Original file line number Diff line number Diff line change @@ -155,6 +155,16 @@ export const VFileInput = genericComponent<VFileInputSlots>()({
155
155
callEvent ( props [ 'onClick:clear' ] , e )
156
156
} )
157
157
}
158
+ function onDragover ( e : DragEvent ) {
159
+ e . preventDefault ( )
160
+ }
161
+ function onDrop ( e : DragEvent ) {
162
+ e . preventDefault ( )
163
+
164
+ if ( ! e . dataTransfer ) return
165
+
166
+ model . value = [ ...e . dataTransfer . files ?? [ ] ]
167
+ }
158
168
159
169
watch ( model , newValue => {
160
170
const hasModelReset = ! Array . isArray ( newValue ) || ! newValue . length
@@ -215,6 +225,8 @@ export const VFileInput = genericComponent<VFileInputSlots>()({
215
225
disabled = { isDisabled . value }
216
226
focused = { isFocused . value }
217
227
error = { isValid . value === false }
228
+ onDragover = { onDragover }
229
+ onDrop = { onDrop }
218
230
>
219
231
{ {
220
232
...slots ,
You can’t perform that action at this time.
0 commit comments