Skip to content

Print button ​

Opens the browser's print dialog, and keeps itself off the printed page.

Open in demo
Open in demo

Usage ​

No props, no events. It calls window.print().

It carries sa-no-print, so it is not on the sheet it prints. That class is the template's own print utility, and anything else you do not want printed can take it too.

Where it appears on its own ​

The page header renders one automatically when the route carries meta.printable:

ts
{
  path: '/apps/invoice/:id',
  meta: { title: 'Invoice', printable: true },
}

Do not set that on a list page. DataTable's toolbar ships its own print button, so a printable list page shows two. Keep it for printables that are not tables: an invoice, a report, a detail page.

Example ​

API ​

Source: src/shared/components/common/PrintButton.vue

Props ​

None.

Emits ​

None.

Slots ​

None.

Accessibility ​

  • It is an ordinary button with a visible label beside the icon.
  • It is in the tab order and fires on Enter and Space, because it is a real button rather than a clickable icon.