aq-fe-framework 0.1.138 → 0.1.140
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunk-5U2JSHSJ.mjs +22 -0
- package/dist/{chunk-7U5EGTYK.mjs → chunk-6OPAZECG.mjs} +1276 -5285
- package/dist/{chunk-CJDXLINF.mjs → chunk-DRMICFA6.mjs} +0 -20
- package/dist/{chunk-KI5V7QJP.mjs → chunk-Z6OQG54Q.mjs} +1 -1
- package/dist/components/index.css +0 -6
- package/dist/components/index.d.mts +3 -2
- package/dist/components/index.mjs +3 -3
- package/dist/hooks/index.mjs +1 -1
- package/dist/modules-features/index.d.mts +3 -3
- package/dist/modules-features/index.mjs +3985 -73
- package/dist/utils/index.mjs +4 -2
- package/package.json +1 -1
@@ -0,0 +1,22 @@
|
|
1
|
+
// src/utils/utils_pdf.ts
|
2
|
+
import axios from "axios";
|
3
|
+
async function utils_pdf_download(url) {
|
4
|
+
try {
|
5
|
+
const response = await axios.get(url, {
|
6
|
+
responseType: "blob"
|
7
|
+
// Đảm bảo nhận dữ liệu dạng blob để tải file
|
8
|
+
});
|
9
|
+
const blob = new Blob([response.data], { type: "application/pdf" });
|
10
|
+
const link = document.createElement("a");
|
11
|
+
link.href = window.URL.createObjectURL(blob);
|
12
|
+
link.download = "file.pdf";
|
13
|
+
link.click();
|
14
|
+
window.URL.revokeObjectURL(link.href);
|
15
|
+
} catch (error) {
|
16
|
+
console.error("Error downloading PDF:", error);
|
17
|
+
}
|
18
|
+
}
|
19
|
+
|
20
|
+
export {
|
21
|
+
utils_pdf_download
|
22
|
+
};
|