File tree Expand file tree Collapse file tree 3 files changed +8
-8
lines changed Expand file tree Collapse file tree 3 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -8,14 +8,14 @@ export default {
88 totalContents : { type : Number , default : 0 } ,
99 type : { type : String , default : '' } ,
1010 } ,
11- beforeCreate ( ) {
11+ async beforeCreate ( ) {
1212 Object . entries ( this . $options ?. pdfStyle || [ ] ) . forEach ( ( [ selector , rules ] ) => {
1313 styleStore [ selector ] = styleStore [ selector ] || { }
1414 Object . assign ( styleStore [ selector ] , rules )
1515 } )
1616
1717 if ( this . index !== - 1 ) {
18- this . $onProgress ( 'assembleContent' , {
18+ await this . $onProgress ( 'assembleContent' , {
1919 content : this . index + 1 ,
2020 totalContents : this . totalContents ,
2121 type : this . $tc ( `print.${ camelCase ( this . type ) } .title` ) ,
Original file line number Diff line number Diff line change @@ -8,14 +8,14 @@ const fontStore = new FontStore()
88export async function renderPdfStructureToReactPdf (
99 pdfStructure ,
1010 compress = true ,
11- onProgress = ( ) => { }
11+ onProgress = async ( ) => { }
1212) {
1313 await onProgress ( 'layoutDocument' )
1414
1515 let page = 0
16- addEventListener ( 'layoutPage' , ( ) => {
16+ addEventListener ( 'layoutPage' , async ( ) => {
1717 page ++
18- onProgress ( 'layoutPage' , { page } )
18+ await onProgress ( 'layoutPage' , { page } )
1919 } )
2020
2121 const layout = await layoutDocument ( pdfStructure , fontStore )
@@ -37,9 +37,9 @@ export async function renderPdfStructureToReactPdf(
3737 pageMode,
3838 } )
3939
40- ctx . on ( 'pageAdded' , ( ) => {
40+ ctx . on ( 'pageAdded' , async ( ) => {
4141 page ++
42- onProgress ( 'renderingPdfPage' , { page, totalPages } )
42+ await onProgress ( 'renderingPdfPage' , { page, totalPages } )
4343 } )
4444
4545 return renderPDF ( ctx , layout )
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import { nodeOps } from './nodeOps.js'
33// eslint-disable-next-line vue/prefer-import-from-vue
44import { createRenderer } from '@vue/runtime-core'
55
6- export function renderVueToPdfStructure ( root , props = { } , onProgress = ( ) => { } ) {
6+ export function renderVueToPdfStructure ( root , props = { } , onProgress = async ( ) => { } ) {
77 // We need a "root container" (normally the <div id="app"> DOM element).
88 // Vue uses this to keep track of which running Vue app this is.
99 const container = { }
You can’t perform that action at this time.
0 commit comments