adminforth 1.15.0-next.19 → 1.15.0-next.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
|
|
2
|
+
<!-- tag form used to reset the input (method .reset() in claer() function) -->
|
|
3
|
+
<form class="flex items-center justify-center w-full"
|
|
3
4
|
@dragover.prevent="dragging = true"
|
|
4
5
|
@dragleave.prevent="dragging = false"
|
|
5
6
|
@drop.prevent="dragging = false; doEmit($event.dataTransfer.files)"
|
|
@@ -43,12 +44,12 @@
|
|
|
43
44
|
:multiple="props.multiple || false"
|
|
44
45
|
/>
|
|
45
46
|
</label>
|
|
46
|
-
|
|
47
|
+
</form>
|
|
47
48
|
</template>
|
|
48
49
|
|
|
49
50
|
<script setup lang="ts">
|
|
50
51
|
import { humanifySize } from '@/utils';
|
|
51
|
-
import { ref, type Ref } from 'vue';
|
|
52
|
+
import { ref, defineExpose, type Ref } from 'vue';
|
|
52
53
|
import { IconFileSolid } from '@iconify-prerendered/vue-flowbite';
|
|
53
54
|
import { watch } from 'vue';
|
|
54
55
|
import adminforth from '@/adminforth';
|
|
@@ -125,4 +126,14 @@ function doEmit(filesIn: FileList) {
|
|
|
125
126
|
|
|
126
127
|
const dragging = ref(false);
|
|
127
128
|
|
|
129
|
+
function clear() {
|
|
130
|
+
selectedFiles.value = [];
|
|
131
|
+
emit('update:modelValue', []);
|
|
132
|
+
const form = document.getElementById(id)?.closest('form');
|
|
133
|
+
form?.reset();
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
defineExpose({
|
|
137
|
+
clear,
|
|
138
|
+
});
|
|
128
139
|
</script>
|