jsPDF를 가져올 수 있었지만 jspdf-autotable의 autoTable 메서드를 사용할 수 없습니다. jsPDF의 종속성으로 가져 오는 방법을 모르겠습니다. 위의 논의에서 추출Angles 4에서 jspdf-autotable을 사용하는 방법?
import { Injectable, Component } from '@angular/core';
import * as jsPDF from 'jspdf';
import { autoTable } from 'jspdf-autotable';
@Injectable()
export class PdfService {
constructor() {
}
convertJsonToPdf(columns: any, jsonData: any) {
var doc = new jsPDF('p', 'pt'); // OK, created
doc.autoTable(columns, jsonData); // Fails because autoTable is not in doc
}
}
시도로
을;'와' import 'jspdf-autotable';'; –
@ SimonBengtsson 잘 했어, 고마워. – user1916077