1,引入对应的依赖
npm install xlsx
2,导入对应的依赖包
3,上传组件方法编码
<el-upload
class="upload-demo"
ref="upload"
action
:limit="1"
accept=".xlsx, .xls"
:show-file-list="true"
:auto-upload="false"
>
<el-button slot="trigger" size="small" type="primary">上传台账数据</el-button>
<el-button
style="margin-left: 10px;"
size="small"
type="success"
@click="submitUpload"
>解析xlsx</el-button>
<!--