mycurelabs / vue-html-to-paper

Vue mixin for paper printing html elements.
MIT License
298 stars 101 forks source link

Bug: windowTitle option is broken since 2021-07-01 (> v1.4.3) #109

Closed SeanLMcCullough closed 1 year ago

SeanLMcCullough commented 2 years ago

The option windowTitle and potentially others (?) is broken at commit 6a4f093b656694f882a55ae34e9aeaed259dfcc7.

According to the docs, this option should set the window title. In the current build, this feature is broken.

const options = {
  windowTitle: 'Hello!', // override the window title <-----------------------------------
}

Vue.use(VueHtmlToPaper, options);

This replaced the following:

win.document.write(`
  <html>
    <head>
      <title>${windowTitle}</title>
    </head>
    <body>
      ${element.innerHTML}
    </body>
  </html>
`);

With the following:

win.document.write(`
  <html>
    <head>
      <title>${window.document.title}</title>
    </head>
    <body>
      ${element.innerHTML}
    </body>
  </html>
`);