我目前正在尝试使用jspdf-autotable从v-data-table生成数据pdf。 这是我要传递的标头:
headersPDF:[
{title: "Title", datakey:"title"},
{title: "Author", datakey:"author"},
{title: "Description", datakey:"description"},
{title: "Status", datakey: "status"},
{title: "Media Type", datakey: "type"},
{title: "Rating", datakey: "rating"},
{title: "Private", datakey: "private"},
{title: "Created By", datakey: "createdby"},
],
以下是传入数据的格式(来自chrome控制台): Data
这是我用来生成表格的代码:
createPDF(){
var docu = new jsPDF();
//used to create what is seen in the "data" screenshot
let pds = this.simplifyProDevs()
docu.autoTable(this.headersPDF, pds);
docu.save('proDevs.pdf');
},