Windows.print () prints table in iview

solution: use Windows.print () to print all the table, styles in iview, and you can"t get the data when you click on print for the first time. Can you tell me if there is any great god? thank you

.

clipboard.png

clipboard.png

Mar.04,2021

encountered the same problem, you need to import iview and table styles to display properly, node_modules/iview/dist/styles/iview.css

print.js third party
now I am studying how to import the style of table. The idea now is to convert the less file of table into a css file, and then introduce it. I don't know if it is feasible. If there is any progress, please contact me as soon as possible. Thank you

attach code

        this.printLoading = true
        setTimeout(() => {
          PrintJS({
            printable: this.pageId,
            documentTitle: '',
            type: 'html',
            targetStyle: ['*'],
            ignoreElements: [this.actionId],
            maxWidth: 1200,
            css: ['../../../node_modules/iview/dist/styles/iview.css'],
            style: '.main-head {font-size: 16px;font-weight: bold;color: -sharp464c5b}',
            onLoadingEnd: () => {
              this.printLoading = false
            }
          })
        }, 300)
Menu