vue+elementui 实现上传文件/导入文件的功能
1. 上传组件
<el-form-item label="上传文件:">
<el-upload
action=""
:file-list="fileList"
:show-file-list="false"
:http-request="handUpLoad"
drag
:limit="1"
:accept="'.xls, .xlsx'"
>
<i class="el-icon-upload" />
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
</el-upload>
<ul class="downloadFile">
<li v-for="(val, index) in fileList" :key="index">
<a class="el-upload-list__item-name" href="javascript:;"><i class="el-icon-document" />{{ val.fileName }}</a>
<i class="el-icon-close" @click="handleFileRemove(val)" />
</li>
<li v-show="fileLoading"><i class="loading el-icon-loading" /> </li>
</ul>
</el-form-item>
class="hljs-button signin active" data-title="登录复制" data-report-click="{"spm":"1001.2101.3001.4334"}">
评论记录:
回复评论: