我包括了必要的链接,但仍然给我错误。 错误
function pdfWrite() {
var doc = new jsPDF();
var columns = ["ID", "Name", "City"];
var rows = [
[
1, "Shaw", "Tanzania"
],
[
2, "Nelson", "Kazakhstan"
],
[
3, "Garcia", "Madagascar"
]
];
doc.autoTable(columns, rows)
doc.save('table.pdf');
}
工作。
<script>
var doc = new jsPDF();
var columns = ["Bina ID", "Bina Adı", "Özellik"];
var rows = [
[
1, "Shaw", "Tanzania"
],
[
2, "Nelson", "Kazakhstan"
],
[
3, "Garcia", "Madagascar"
]
];
doc.autoTable(columns, rows)
doc.save('table.pdf');
</script>
在索引页上运行时不会给出错误。文件中的函数调用时出错
答案 0 :(得分:0)
您要导入jspdf-autotable吗?应该看起来像这样:
let jsPDF = require('jspdf');
require('jspdf-autotable');