feat: download manual all
This commit is contained in:
parent
32e1bf94a4
commit
1d97fb58b0
2 changed files with 15 additions and 4 deletions
|
|
@ -43,12 +43,23 @@ onMounted(async () => {
|
|||
}
|
||||
});
|
||||
|
||||
const downloadFile = () => {
|
||||
const downloadManual = () => {
|
||||
const fileName = route.fullPath.split("/").pop();
|
||||
const pdfUrl = window.location.href.split("manual/").join("") + ".pdf";
|
||||
const link = document.createElement("a");
|
||||
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);
|
||||
link.click();
|
||||
document.body.removeChild(link);
|
||||
|
|
@ -96,7 +107,7 @@ const downloadFile = () => {
|
|||
clickable
|
||||
class="row items-center no-wrap"
|
||||
v-close-popup
|
||||
@click="downloadFile()"
|
||||
@click="downloadManual()"
|
||||
>
|
||||
<q-icon
|
||||
color="red"
|
||||
|
|
@ -110,7 +121,7 @@ const downloadFile = () => {
|
|||
clickable
|
||||
class="row items-center no-wrap"
|
||||
v-close-popup
|
||||
@click=""
|
||||
@click="downloadManualAll()"
|
||||
>
|
||||
<q-icon
|
||||
color="red"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue