Behold my brilliant Vue component:
<template>
...
<b-modal id="modalInvoice" size="lg" title="Invoice">
<Invoice/>
<div slot="modal-footer" class="w-100">
<b-btn size="sm" class="float-right" variant="warning" @click="show=false">
<i class="fa fa-print"></i> Print
</b-btn>
</div>
</b-modal>
...
<b-btn variant="warning" class="btn-square mt-2" v-b-modal.modalInvoice @click="checkout()"><i class="fa fa-credit-card-alt"></i> Checkout </b-btn>
...
</template>
<script>
...
export default {
...
methods: {
print() {
window.print()
}
}
}
</script>
The issue at hand arises when clicking on the print button. The entire website appears in the print preview, while the intention was for only the modal content to be displayed.
A query emerges - how can this printing predicament be resolved?