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 downloadControl = computed(() => vpvRef.value?.downloadControl)
|
||||||
|
|
||||||
const handleDownloadFile = async () => {
|
const handleDownloadFile = async () => {
|
||||||
|
if(props.fileId){
|
||||||
await useFiles().downloadFile(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)
|
/*const downloadCtrl = unref(downloadControl)
|
||||||
if (!downloadCtrl) return
|
if (!downloadCtrl) return
|
||||||
@@ -172,7 +183,7 @@ watch(downloadControl, (downloadCtrl) => {
|
|||||||
variant="outline"
|
variant="outline"
|
||||||
></UButton>
|
></UButton>
|
||||||
<UButton
|
<UButton
|
||||||
v-if="props.fileId"
|
v-if="props.fileId || props.uri"
|
||||||
@click="handleDownloadFile"
|
@click="handleDownloadFile"
|
||||||
variant="outline"
|
variant="outline"
|
||||||
icon="i-heroicons-arrow-down-on-square"
|
icon="i-heroicons-arrow-down-on-square"
|
||||||
|
|||||||
Reference in New Issue
Block a user