Added Download Option for Drafts/Base64
This commit is contained in:
@@ -127,7 +127,18 @@ const handleKeyPress = (event) => {
|
||||
const downloadControl = computed(() => vpvRef.value?.downloadControl)
|
||||
|
||||
const handleDownloadFile = async () => {
|
||||
await useFiles().downloadFile(props.fileId)
|
||||
if(props.fileId){
|
||||
await useFiles().downloadFile(props.fileId)
|
||||
} else if(props.uri){
|
||||
const a = document.createElement("a");
|
||||
a.href = props.uri;
|
||||
a.download = "entwurf.pdf";
|
||||
document.body.appendChild(a);
|
||||
a.click();
|
||||
document.body.removeChild(a);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*const downloadCtrl = unref(downloadControl)
|
||||
if (!downloadCtrl) return
|
||||
@@ -172,7 +183,7 @@ watch(downloadControl, (downloadCtrl) => {
|
||||
variant="outline"
|
||||
></UButton>
|
||||
<UButton
|
||||
v-if="props.fileId"
|
||||
v-if="props.fileId || props.uri"
|
||||
@click="handleDownloadFile"
|
||||
variant="outline"
|
||||
icon="i-heroicons-arrow-down-on-square"
|
||||
|
||||
Reference in New Issue
Block a user