From 8658217baa2f2df68223fcc3f7b56fba844d6f57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E6=9D=A8?= <1711467488@qq.com> Date: Sun, 11 Feb 2018 22:38:55 +0800 Subject: [PATCH] no message Former-commit-id: 790cbb22968ec5539df092e91148e7cc75baf8c1 Former-commit-id: b86992bc97242244f343f0311cae6400adf24641 Former-commit-id: 7d67b7feff3025551a4881da6e75fa11b7ab2fd4 --- src/pages/demo/plugins/tableExport/demo.vue | 8 ++++---- src/plugin/export/index.js | 7 ++----- static/markdownFiles/article/插件 - 导出数据.md | 4 +++- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/pages/demo/plugins/tableExport/demo.vue b/src/pages/demo/plugins/tableExport/demo.vue index 01a73568..0fead660 100644 --- a/src/pages/demo/plugins/tableExport/demo.vue +++ b/src/pages/demo/plugins/tableExport/demo.vue @@ -47,8 +47,8 @@ export default { columns: this.table.columns, data: this.table.data }) - .then(data => { - this.$log('exportCsv', data) + .then(() => { + this.$message('导出CSV成功') }) }, exportExcel () { @@ -56,8 +56,8 @@ export default { columns: this.table.columns, data: this.table.data }) - .then(data => { - this.$log('exportExcel', data) + .then(() => { + this.$message('导出表格成功') }) } } diff --git a/src/plugin/export/index.js b/src/plugin/export/index.js index 22caa7bb..76ed037f 100644 --- a/src/plugin/export/index.js +++ b/src/plugin/export/index.js @@ -22,7 +22,7 @@ export default { // 下载数据 ExportCsv.download(_params.title, data) // 完成 - resolve(data) + resolve() }) }, // 导出 Excel @@ -42,10 +42,7 @@ export default { // 导出 Excel Excel.export_json_to_excel(header, data, _params.title) // 完成 - resolve({ - header, - data - }) + resolve() }) } } diff --git a/static/markdownFiles/article/插件 - 导出数据.md b/static/markdownFiles/article/插件 - 导出数据.md index aaa75651..3a89384d 100644 --- a/static/markdownFiles/article/插件 - 导出数据.md +++ b/static/markdownFiles/article/插件 - 导出数据.md @@ -15,7 +15,7 @@ Vue.use(pluginExport) ## Vue.$export.csv() -此方法将数据以 `CSV` 格式导出,并且返回一个 `Promise` ,可以使用 `then` 回调 +此方法将数据以 `CSV` 格式导出,并且返回一个 `Promise` 对象 使用 @@ -71,6 +71,8 @@ this.$export.csv({ ## Vue.$export.excel() +此方法将数据以 `xlsx` 格式导出,并且返回一个 `Promise` 对象 + 使用 ```