赞
踩
写项目时发现上传组件会默认以当前页面域名调用一次接口 报错404,虽然没什么影响但是还是制止一下这个行为吧~
以下是解决方法
使用方法:
customRequest:通过覆盖默认的上传行为,可以自定义自己的上传实现
- <a-upload class="action" v-model:fileList="state.fileList" :showUploadList="false"
- :customRequest="customRequest" @change="uploadSubmit"></a-upload>
- // 屏蔽upload组件默认当前页面域名进行访问静态资源行为
- const customRequest = (file: any) => {
- setTimeout(() => {
- file.onSuccess();
- }, 0);
- };
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。