当前位置:网站首页>jeecgboot 导入文档
jeecgboot 导入文档
2022-07-23 03:23:00 【weixin_38673922】
<template>
<div class="clearfix">
<a-upload :fileList="fileList" :remove="handleRemove" :beforeUpload="beforeUpload">
<a-button> <a-icon type="upload" /> Select File </a-button>
</a-upload>
<a-button
type="primary"
@click="handleUpload"
:disabled="fileList.length === 0"
:loading="uploading"
style="margin-top: 16px"
>
{
{
uploading ? 'Uploading' : 'Start Upload' }}
</a-button>
</div>
</template>
<script>
import reqwest from 'reqwest';
export default {
data() {
return {
fileList: [],
uploading: false,
};
},
methods: {
handleRemove(file) {
const index = this.fileList.indexOf(file);
const newFileList = this.fileList.slice();
newFileList.splice(index, 1);
this.fileList = newFileList;
},
beforeUpload(file) {
this.fileList = [...this.fileList, file];
return false;
},
handleUpload() {
const {
fileList } = this;
const formData = new FormData();
fileList.forEach(file => {
formData.append('files[]', file);//后面再加上token
});
this.uploading = true;
// You can use any AJAX library you like
request({
url: 'https://www.mocky.io/v2/5cc8019d300000980a055e76',
method: 'post',
processData: false,
data: formData,
success: () => {
this.fileList = [];
this.uploading = false;
this.$message.success('upload successfully.');
},
error: () => {
this.uploading = false;
this.$message.error('upload failed.');
},
});
},
},
};
</script>
边栏推荐
- Baidu map eagle eye track service
- 笔记——记录@RefreshScope动态刷新配置失效的解决方式
- Realize multi-level conditional query (similar to JD multi-level add query)
- 目标检测xml文件实现mixup数据增强(修改文件路径直接能用,非常方便)
- 海通证券场内基金开户怎么样安全吗
- Ten years of sharpening a sword, the core technology evolution of the cloud native distributed database polardb-x
- This is how the permission system is designed, yyds
- [learning notes] node -- from 0 foundation to actual enterprise official website
- 赚钱能力”是需要积累的
- 【循环语句】
猜你喜欢

The gospel of small and medium-sized enterprises is coming! Jnpf is becoming popular, helping business digital upgrading

What are you doing at two in the morning?

Airtest脚本的点击位置与点击偏移

隐藏网站服务器响应头中 PHP 版本信息

网络通信原理与IP地址的分配原理,网络七层由下往上分别为物理层、数据链路层、网络层、传输层、会话层、表示层和应用层

redis分片集群如何搭建与使用

用现代化的开发方法和思维,打跑遗留系统“拦路虎”

【C语言基础】15 位运算

Visual full link log tracking

spark分区算子partitionBy、coalesce、repartition
随机推荐
华泰证券网上开户安全吗是真的吗
60 open-ended test questions, recite them and get a pay rise directly
技术分享 | 大事务阻塞 show master status
七大排序--万字详解
智能建造试点城市通知的三大目标和八项任务
软考 系统架构设计师 简明教程 | 需求工程
在线问题反馈模块实战(十一):实现图片下载功能
利用反射对修饰符为final的成员变量进行修改
PHP script paging TXT content case
Comprehensive summary of software quality management practice
Click position and click offset of airtest script
The method of page Jump in PHP
leetcode 1074. Number of Submatrices That Sum to Target(和为target的子矩阵个数)
The technical points of the new project can be guided if necessary
Multi-UA V Cooperative Exploringfor the Unknown Indoor EnvironmentBased on Dynamic Target Tracking翻译
How to classify the same field values in a list under the same list
【VSCODE】当前工作目录非当前文件夹/pathlib打印cwd路径错误
This tool complements the last kilometer of JMeter performance analysis
用现代化的开发方法和思维,打跑遗留系统“拦路虎”
[learning notes] node -- from 0 foundation to actual enterprise official website