博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
vant-upload上传
阅读量:4112 次
发布时间:2019-05-25

本文共 873 字,大约阅读时间需要 2 分钟。

在使用vant组件vant-upload上传图片的时候,代码如下:

//html
//jsonRead(file, detail) { let self = this; let data = new FormData(); if (file instanceof Array) { file.forEach((item, index) => { window.console.log('index', index); self.data.append(`file${index}`, item.file); }) } else { self.data.append(`file`, file.file) } window.console.log('file:', file, 'detail:', detail); /*this.upload(data) .then((res) => { window.console.log('res:', res); }) .catch(reason => { window.console.log(reason); })*/ }

后端正常接收

转载地址:http://dorsi.baihongyu.com/

你可能感兴趣的文章
Pascal's Triangle -- 生成杨辉三角
查看>>
Pascal's Triangle II 生成杨辉三角中的某行
查看>>
Minimum Depth of Binary Tree -- 二叉树的最小深度 DFS 加剪枝
查看>>
Climbing Stairs 爬楼梯方法 动态规划
查看>>
Merge Two Sorted Lists 合并两个有序链表
查看>>
pow(x,n) 为什么错这么多次
查看>>
Jump Game 动态规划
查看>>
Binary Tree Maximum Path Sum 自底向上求解(重重重重)
查看>>
Subsets 深搜
查看>>
Subsets II
查看>>
Edit Distance 字符串距离(重重)
查看>>
Gray Code 格雷码
查看>>
对话周鸿袆:从程序员创业谈起
查看>>
web.py 0.3 新手指南 - 如何用Gmail发送邮件
查看>>
web.py 0.3 新手指南 - RESTful doctesting using app.request
查看>>
web.py 0.3 新手指南 - 使用db.query进行高级数据库查询
查看>>
web.py 0.3 新手指南 - 多数据库使用
查看>>
一步步开发 Spring MVC 应用
查看>>
python: extend (扩展) 与 append (追加) 的差别
查看>>
「译」在 python 中,如果 x 是 list,为什么 x += "ha" 可以运行,而 x = x + "ha" 却抛出异常呢?...
查看>>