feat: download manual all

This commit is contained in:
oat_dev 2024-06-28 10:05:44 +07:00
parent 32e1bf94a4
commit 1d97fb58b0
2 changed files with 15 additions and 4 deletions

BIN
public/manual-all.pdf Normal file

Binary file not shown.

View file

@ -43,12 +43,23 @@ onMounted(async () => {
} }
}); });
const downloadFile = () => { const downloadManual = () => {
const fileName = route.fullPath.split("/").pop(); const fileName = route.fullPath.split("/").pop();
const pdfUrl = window.location.href.split("manual/").join("") + ".pdf"; const pdfUrl = window.location.href.split("manual/").join("") + ".pdf";
const link = document.createElement("a"); const link = document.createElement("a");
link.href = pdfUrl; link.href = pdfUrl;
link.download = `${fileName}.pdf`; // link.download = fileName ?? ""; //
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
};
const downloadManualAll = () => {
const fileName = "manual-all.pdf";
const pdfUrl = window.location.origin + "/manual-all.pdf";
const link = document.createElement("a");
link.href = pdfUrl;
link.download = `${fileName}`; //
document.body.appendChild(link); document.body.appendChild(link);
link.click(); link.click();
document.body.removeChild(link); document.body.removeChild(link);
@ -96,7 +107,7 @@ const downloadFile = () => {
clickable clickable
class="row items-center no-wrap" class="row items-center no-wrap"
v-close-popup v-close-popup
@click="downloadFile()" @click="downloadManual()"
> >
<q-icon <q-icon
color="red" color="red"
@ -110,7 +121,7 @@ const downloadFile = () => {
clickable clickable
class="row items-center no-wrap" class="row items-center no-wrap"
v-close-popup v-close-popup
@click="" @click="downloadManualAll()"
> >
<q-icon <q-icon
color="red" color="red"