ant-vue+input原生下载文件
重点注意:
代码:
HTML:
Markup
<a-button type="primary" v-if="hasPerm('entEnterprisearchives:add')" icon="plus" @click="showModal">导入</a-button>
<a-modal v-model="visible" title="批量导入" @ok="handleFile" class="import-file">
<div style="margin-left:15px;">
企业档案:
<a-button type="primary" class="select-btn pos-r" id="btn" @click="chooseFile">
选择文件
<input id="chooseFile" type="file" class="pos-a" @change="getFile">
</a-button>
{{fileInfo.name}}
</div>
<div class="tip">请按照模板文件填写完整信息,带*号的为必填项,缺少必填项的数据将无法被导入</div>
<a-button type="link" @click="downloadTpl">下载模板</a-button>
</a-modal>
VUE代码:
Markup
效果: