perf[UploadExcel-component]: tweaks

This commit is contained in:
Pan
2018-06-12 10:53:08 +08:00
parent 9f8ac37497
commit c93fcefe54
2 changed files with 11 additions and 10 deletions

View File

@@ -1,6 +1,6 @@
<template>
<div class="app-container">
<upload-excel-component @on-selected-file='selected'></upload-excel-component>
<upload-excel-component @success='handleSuccess'></upload-excel-component>
<el-table :data="tableData" border highlight-current-row style="width: 100%;margin-top:20px;">
<el-table-column v-for='item of tableHeader' :prop="item" :label="item" :key='item'>
</el-table-column>
@@ -21,9 +21,9 @@ export default {
}
},
methods: {
selected(data) {
this.tableData = data.results
this.tableHeader = data.header
handleSuccess({ results, header }) {
this.tableData = results
this.tableHeader = header
}
}
}