From c97b923003a6b9ec60eece0c2ee1abaae6eee9c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E6=9D=A8?= <1711467488@qq.com> Date: Thu, 15 Feb 2018 23:34:17 +0800 Subject: [PATCH] no message Former-commit-id: 85cc3194e4773a565281bc2cfeccdbfea7040a15 Former-commit-id: 09fdb8d799737bbd072fbed250096cfbaecd0898 Former-commit-id: ffe5c9bedf9c13b23767f2a2ca24684e935601f4 --- static/markdownFiles/article/插件 - 导入.md | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/static/markdownFiles/article/插件 - 导入.md b/static/markdownFiles/article/插件 - 导入.md index 6d98873d..3f25b777 100644 --- a/static/markdownFiles/article/插件 - 导入.md +++ b/static/markdownFiles/article/插件 - 导入.md @@ -17,14 +17,6 @@ Vue.use(pluginImport) 导入csv文件,并且返回一个 `Promise` 对象 -参数 - -| 参数名 | 介绍 | 必选 | 值类型 | 可选值 | 默认值 | -| --- | --- | --- | --- | --- | --- | -| file | 选择的文件 | 是 | File | | | - -使用 - ``` // 在选择文件后调用 handleUpload (file) { @@ -45,19 +37,17 @@ handleUpload (file) { 导入xlsx文件,并且返回一个 `Promise` 对象 -参数 +**注意 导入的表格文件第一行应为表头** -| 参数名 | 介绍 | 必选 | 值类型 | 可选值 | 默认值 | -| --- | --- | --- | --- | --- | --- | -| file | 选择的文件 | 是 | File | | | - -使用 +参考下述示例使用 ``` // 在选择文件后调用 handleUpload (file) { this.$import.xlsx(file) .then(({header, results}) => { + // header 为表头 + // results 为内容 this.table.columns = header.map(e => { return { label: e,