Skip to content

Commit 909bb42

Browse files
fix: pdf
1 parent 31d4d2c commit 909bb42

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

ui/src/components/pdf-export/index.vue

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,12 @@
1010
>
1111
<div
1212
v-loading="loading"
13-
style="max-height: calc(100vh - 200px); overflow-y: auto; display: flex; justify-content: center"
13+
style="
14+
max-height: calc(100vh - 200px);
15+
overflow-y: auto;
16+
display: flex;
17+
justify-content: center;
18+
"
1419
>
1520
<div ref="cloneContainerRef" style="width: 100%"></div>
1621
<div ref="svgContainerRef"></div>
@@ -117,6 +122,8 @@ const exportPDF = () => {
117122
nextTick(() => {
118123
html2Canvas(svgContainerRef.value, {
119124
logging: false,
125+
allowTaint: true,
126+
useCORS: true,
120127
})
121128
.then((canvas) => {
122129
const doc = new jsPDF('p', 'mm', 'a4')
@@ -162,6 +169,8 @@ const exportJepg = () => {
162169
nextTick(() => {
163170
html2Canvas(svgContainerRef.value, {
164171
logging: false,
172+
allowTaint: true,
173+
useCORS: true,
165174
})
166175
.then((canvas) => {
167176
// 将canvas转换为图片

0 commit comments

Comments
 (0)