-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(pdfmake): add pdfmake via script instead of esm import
- Loading branch information
Showing
9 changed files
with
7,340 additions
and
873 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<template> | ||
<main class="w-full divide-x flex justify-center"> | ||
<div class="w-1/2 h-screen bg-red-50"></div> | ||
<div class="w-1/2 h-screen bg-blue-50"> | ||
<VuePDF :pdf="pdfLink" v-if="pdfLink" fit-parent /> | ||
</div> | ||
</main> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import { VuePDF, usePDF } from "@tato30/vue-pdf"; | ||
const { $pdfMake: pdf } = useNuxtApp(); | ||
const pdfLink = ref(""); | ||
const loadPdf = () => { | ||
.createPdf({ | ||
content: [ | ||
"First paragraph", | ||
"Another paragraph, this time a little bit longer to make sure, this line will be divided into at least two lines", | ||
], | ||
}) | ||
.getDataUrl((dataUrl) => { | ||
pdfLink.value = dataUrl; | ||
}); | ||
}; | ||
onMounted(() => { | ||
loadPdf(); | ||
}); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Basic | ||
|
||
::BasicExample | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.