From f6c579439be51e599609ac8d1d92eacc2de1c23b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E6=9D=A8?= <1711467488@qq.com> Date: Mon, 12 Feb 2018 18:17:49 +0800 Subject: [PATCH] no message Former-commit-id: 99584dd8e31d00a1439b5032c44cf67883f6db04 Former-commit-id: 7e665ff5a7c4a7ade997b25ba8495e06f508bcd1 Former-commit-id: 490c650b67bdf99c7536e2d87c458aecdbf9739d --- static/markdownFiles/article/插件 - 导出.md | 51 ++++++++++++++++++++- 1 file changed, 50 insertions(+), 1 deletion(-) diff --git a/static/markdownFiles/article/插件 - 导出.md b/static/markdownFiles/article/插件 - 导出.md index a275deaf..eea5615a 100644 --- a/static/markdownFiles/article/插件 - 导出.md +++ b/static/markdownFiles/article/插件 - 导出.md @@ -124,4 +124,53 @@ this.$export.excel({ ## Vue.$export.txt() -见导出文本演示页 +此方法将数据以 `xlsx` 格式导出,并且返回一个 `Promise` 对象 + +使用 + +``` +this.$export.excel({ + columns, + data +}) + .then(data => { + // ...可选回调 + }) +``` + +参数 + +| 参数名 | 介绍 | 必选 | 值类型 | 可选值 | 默认值 | +| --- | --- | --- | --- | --- | --- | +| columns | 列 | 非 | Array | | 空数组 | +| data | 行数据 | 非 | Array | | 空数组 | +| table | 文件名 | 非 | String | | table | + +示例 + +``` +const columns = [ + { + label: '姓名', + prop: 'name' + }, + { + label: '年龄', + prop: 'age' + } +] +const data = [ + { + name: 'lucy', + age: 24 + }, + { + name: 'bob', + age: 26 + } +] +this.$export.excel({ + columns, + data +}) +```