[Vuejs]-How to use the @page css rule with vue.js

0👍

The <style> tag can be anywhere in you HTML document. So as a workaround you could add a <style> tag inside your <template> like so:

<template>
  <div>
    <style>
      @page {
        margin: 0;
        size: A4 landscape;
      }
    </style>
    ...
  </div>
</template>

It may not be the cleanest of solutions but it gets the job done and only applies your @page rule on this one page.

Leave a comment