Added Frontend
This commit is contained in:
42
frontend/components/DocumentUpload.vue
Normal file
42
frontend/components/DocumentUpload.vue
Normal file
@@ -0,0 +1,42 @@
|
||||
<script setup >
|
||||
|
||||
import DocumentUploadModal from "~/components/DocumentUploadModal.vue";
|
||||
|
||||
const props = defineProps({
|
||||
type: {
|
||||
type: String
|
||||
},
|
||||
elementId: {
|
||||
type: String
|
||||
}
|
||||
})
|
||||
|
||||
const {type, elementId} = props
|
||||
|
||||
const emit = defineEmits(["uploadFinished"])
|
||||
|
||||
const modal = useModal()
|
||||
|
||||
const openModal = () => {
|
||||
let fileProps = {folder: null, type: null, typeEnabled: true}
|
||||
|
||||
fileProps[props.type] = props.elementId
|
||||
|
||||
console.log(fileProps)
|
||||
|
||||
modal.open(DocumentUploadModal,{fileData: fileProps, onUploadFinished: () => emit("uploadFinished")})
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<UButton
|
||||
@click="openModal"
|
||||
icon="i-heroicons-arrow-up-tray"
|
||||
>
|
||||
Hochladen
|
||||
</UButton>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
Reference in New Issue
Block a user