赞
踩
<el-upload ref="upload" :headers="myHeaders" class="avatar-uploader avatar-uploaderOne" action="http://47.93.4.35:9090/shop/upload" :http-request="uploadImg" :show-file-list="false" :on-preview="handlePreview" :on-success="handleAvatarSuccess" :onSuccess="uploadSuccess" :on-change="handleChange" :before-upload="beforeAvatarUpload" :before-remove="beforeRemove" :auto-upload="false" //因为这里设置了自动上传为false > <img v-if="true" :src="imageUrl" class="avatar"> <i v-else class="el-icon-plus avatar-uploader-icon" style="margin-left: -20px"></i> </el-upload>
:auto-upload="false"
这里设置了false
不会自动上传,自然无法触发:http-request
绑定的方法
解决方法::auto-upload="true"
或者直接去掉,默认就是为true
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。