fix(ResearchReport): dynamically import print-js
This commit is contained in:
@ -1,5 +1,4 @@
|
||||
<script setup lang="ts">
|
||||
import printJS from 'print-js'
|
||||
import { marked } from 'marked'
|
||||
import { writeFinalReport } from '~/lib/deep-research'
|
||||
import {
|
||||
@ -34,6 +33,8 @@
|
||||
loadingExportMarkdown.value,
|
||||
)
|
||||
|
||||
let printJS: typeof import('print-js') | undefined
|
||||
|
||||
async function generateReport() {
|
||||
loading.value = true
|
||||
error.value = ''
|
||||
@ -88,6 +89,10 @@
|
||||
// Wait after title is changed
|
||||
await new Promise((r) => setTimeout(r, 100))
|
||||
|
||||
if (!printJS) {
|
||||
printJS = (await import('print-js')).default
|
||||
}
|
||||
|
||||
printJS({
|
||||
printable: reportHtml.value,
|
||||
type: 'raw-html',
|
||||
|
Reference in New Issue
Block a user