vant 实现h5页面在移动端上传图片
<van-uploader
v-show="capSign == 0"
:after-read="afterReadBefore"
v-model="beforeArkList"
multiple
:max-count="9"
/>
afterReadBefore(file) {
// 此时可以自行将文件上传至服务器
let formData = new FormData();
formData.append("userId", window.localStorage.getItem("userId"));
formData.append("storeId", this.storeId);
this.beforeArkList.forEach(item => {
formData.append("counterFrontFile", item.file);
})
this.beforeFormData = formData
},
欢迎关注公众号:【抓住重点】,获取更多编程周边技能,与博主一起进步