<van-uploader accept="image/png, image/jpeg,image/jpg" :after-read="afterRead">
    <van-icon class="evaluateTopImgBtnIcon" name="plus" />
    <span>添加图片</span>
</van-uploader>

//图片读取后函数
afterRead(res){
    console.log(res);
    let formData = new FormData();
    formData.append("file",res.file);
    this.$axios.post(url,formData,{
        headers: { //添加请求头
            "Content-Type": "multipart/form-data"
        }
    }).then(res=>{
        console.log(res);
    })

    
},
Logo

前往低代码交流专区

更多推荐