[Vuejs]-How to use Paged.js in Vue.js3?

0👍

I found another reference, for anyone who needs it.

// App.vue

<script lang="ts">
  import { onMounted } from 'vue';
  
  onMounted(()=>{
    let paged = new Previewer();
  
    let flow = paged.preview().then((flow) => {
      console.log("Rendered", flow.total, "pages.");
    })
  });
</script>

<template ref="template">
  <div>hello</div>
</template>

<style lang="scss">
  @import 'pagedjs.scss';
</style>
// pagedjs.scss

@page {
  size: A4 landscape !important;

  @top-left {
    content: "should be shown on the top-left";
    font-size: 15px;
    color: #979797;
    text-align: left;
  }
}
// styling....

Leave a comment