This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2026-02-12 10:13:38 +07:00
parent 6288114e78
commit 3d5405d676
3 changed files with 47 additions and 175 deletions

View file

@ -174,6 +174,27 @@ async function fetchPDF(data: any, type: string = "docx?folder=command") {
});
}
/** Navigate to previous page*/
function goToPreviousPage() {
if (canGoPrevious.value) {
page.value--;
}
}
/** Navigate to next page*/
function goToNextPage() {
if (canGoNext.value) {
page.value++;
}
}
function cleanupObjectUrl() {
if (currentObjectUrl.value) {
URL.revokeObjectURL(currentObjectUrl.value);
currentObjectUrl.value = null;
}
}
watch(
() => modal.value,
async () => {
@ -188,6 +209,7 @@ watch(
hideLoader();
});
} else {
cleanupObjectUrl();
tab.value = "main";
pdfSrc.value = undefined;
page.value = 1;
@ -195,24 +217,6 @@ watch(
}
);
/**
* Navigate to previous page
*/
function goToPreviousPage() {
if (canGoPrevious.value) {
page.value--;
}
}
/**
* Navigate to next page
*/
function goToNextPage() {
if (canGoNext.value) {
page.value++;
}
}
/** check tab เมื่อมีการเปลี่ยน tab*/
watch(
() => tab.value,