21 lines
477 B
Vue
21 lines
477 B
Vue
<template>
|
|
<iframe ref="printFrame" class="hidden" />
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import { ref } from 'vue'
|
|
import { usePdfPrinter } from '~/composables/usePdfPrinter'
|
|
|
|
const printFrame = ref<HTMLIFrameElement | null>(null)
|
|
const { printPdf } = usePdfPrinter()
|
|
|
|
// Expose une methode simple pour imprimer un PDF depuis les ecrans.
|
|
const print = async (url: string): Promise<void> => {
|
|
return printPdf(url, printFrame)
|
|
}
|
|
|
|
defineExpose({
|
|
print
|
|
})
|
|
</script>
|