Element_UI的el-upload通过change方法上传出现2次请求与请服务器地址报错405处理
<el-upload
:show-file-list="false"
action="#"
:on-change="uploadSectionFile"
>
<img
src="@/images/upload.png"
alt=""
style="cursor: pointer"
/>
</el-upload>
上述代码,就会出现请求两次上传接口问题并且额外请求一次服务器地址。(如图所示)

此时,我们只需要添加 :auto-upload=“false” 在el-upload中即可解决这个问题!
文章讲述了ElementUI中的el-upload组件使用change方法上传文件时,会触发两次请求并可能导致405错误。解决方法是在el-upload中添加`auto-upload=false`属性。
6902

被折叠的 条评论
为什么被折叠?



