|
2 | 2 | <FetchingData v-if="loading" /> |
3 | 3 | <FileUploader |
4 | 4 | v-else |
5 | | - v-bind="{ multiple, accept, files, auto_upload }" |
| 5 | + v-bind="{ multiple, accept, files: internal_files, auto_upload }" |
6 | 6 | @files_uploaded="files_uploaded_event" |
7 | 7 | /> |
8 | 8 | </template> |
9 | 9 |
|
10 | 10 | <script setup> |
11 | 11 | import schemas from "@geode/opengeodeweb-back/opengeodeweb_back_schemas.json" |
12 | 12 |
|
13 | | - import FetchingData from "./FetchingData.vue" |
14 | | - import FileUploader from "./FileUploader.vue" |
| 13 | + import FetchingData from "@ogw_front/components/FetchingData.vue" |
| 14 | + import FileUploader from "@ogw_front/components/FileUploader.vue" |
15 | 15 |
|
16 | 16 | const schema = schemas.opengeodeweb_back.allowed_files |
17 | 17 | const emit = defineEmits([ |
|
27 | 27 | auto_upload: { type: Boolean, required: false, default: true }, |
28 | 28 | }) |
29 | 29 |
|
30 | | - const { auto_upload, multiple, supported_feature } = props |
| 30 | + const { auto_upload, multiple, files, supported_feature } = props |
| 31 | +
|
| 32 | + const internal_files = toRef(() => props.files) |
31 | 33 | const accept = ref("") |
32 | 34 | const loading = ref(false) |
33 | 35 |
|
| 36 | + if (props.files.length) { |
| 37 | + internal_files.value = props.files |
| 38 | + if (props.auto_upload) { |
| 39 | + upload_files() |
| 40 | + } |
| 41 | + } |
| 42 | +
|
34 | 43 | const toggle_loading = useToggle(loading) |
35 | 44 |
|
36 | 45 | function files_uploaded_event(value) { |
|
55 | 64 | ) |
56 | 65 | toggle_loading() |
57 | 66 | } |
58 | | - await get_allowed_files() |
| 67 | + get_allowed_files() |
59 | 68 | </script> |
0 commit comments