import {
getToken } from '@/utils/cookies';
import defaultSetting from '@/defaultSetting';
const self = this;
function beforeUpload(file) {
//格式自选,类型自己定义
const isXlsx= file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';
if (!isXlsx) {
message.error('只能上传 xlsx 文件!');
}
const isLt5M = file.size / 1024 / 1024 < 5;
if (!isLt5M) {
message.error('Xlsx 上传不能超过 5MB!');
}
return isLt5M&&self.setState({
loading:false
导入,上传 import {Upload} from 'antd'
最新推荐文章于 2022-12-24 22:27:23 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)