目前在寫vue想要將Table(.bootstrapTable生成的)匯出Excel來
使用tableExport的時候有遇到一些小問題
javascript:
<script src="Scripts/tableExport.min.js"></script>
網頁的地方放入button:
<button v-on:click="click" class="btn btn-danger">匯出檔案</button>
在vue底下建立click事件:
1.
$('#table').tableExport();
2.
$('#table').tableExport({ type: 'excel', escape: 'false', fileName: sTitle +
getToday(), formats: ["xlsx"], });
3.
$("#table").tableExport({
headings: true,
footers: true,
formats: ["xls"],
fileName: sTitle + getToday(),
bootstrap: true,
position: "top",
ignoreRows: null,
ignoreCols: null,
ignoreCSS: ".tableexport-ignore",
emptyCSS: ".tableexport-empty",
trimWhitespace: false,
});