diff --git a/src/plugin/export/index.js b/src/plugin/export/index.js index 654d367d..202de44e 100644 --- a/src/plugin/export/index.js +++ b/src/plugin/export/index.js @@ -14,6 +14,7 @@ export default { } // 合并参数 const _params = Object.assign({}, paramsDefault, params) + console.log(_params) // 生成数据 const data = Csv(_params.columns, _params.data, params, _params.noHeader) // 下载数据 diff --git a/static/markdownFiles/article/插件 - 导出数据.md b/static/markdownFiles/article/插件 - 导出数据.md index ae24d1ad..235453bd 100644 --- a/static/markdownFiles/article/插件 - 导出数据.md +++ b/static/markdownFiles/article/插件 - 导出数据.md @@ -14,9 +14,29 @@ Vue.use(pluginExport) 使用方法 ``` +const columns = [ + { + label: '姓名', + prop: 'name' + }, + { + label: '年龄', + prop: 'age' + } +] +const data = [ + { + name: 'lucy', + age: 24 + }, + { + name: 'bob', + age: 26 + } +] this.$export.csv({ - columns: this.table.columns, - data: this.table.data + columns, + data }) ```