Skip to content

Commit

Permalink
bugfix: 添加上传模拟地址解决微信小程序模拟上传图片一直出于上传中问题
Browse files Browse the repository at this point in the history
  • Loading branch information
BeiQiaoT committed Apr 13, 2022
1 parent f1803ec commit 11c577c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pages/componentsB/upload/upload.nvue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
@delete="deletePic"
name="1"
multiple
:maxCount="10"
:maxCount="10"
></u-upload>
</view>
</view>
Expand Down Expand Up @@ -109,7 +109,7 @@
url: 'https://cdn.uviewui.com/uview/swiper/1.jpg',
}],
fileList4: [{
url: 'https://cdn.uviewui.com/uview/swiper/1.jpg',
url: 'https://cdn.uviewui.com/uview/swiper/1.jpg',
},
{
url: 'https://cdn.uviewui.com/uview/swiper/1.jpg',
Expand All @@ -128,7 +128,7 @@
this[`fileList${event.name}`].splice(event.index, 1)
},
// 新增图片
async afterRead(event) {
async afterRead(event) {
// 当设置 mutiple 为 true 时, file 为数组格式,否则为对象格式
let lists = [].concat(event.file)
let fileListLen = this[`fileList${event.name}`].length
Expand All @@ -153,7 +153,7 @@
uploadFilePromise(url) {
return new Promise((resolve, reject) => {
let a = uni.uploadFile({
url: '', // 仅为示例,非真实的接口地址
url: 'http://www.example.com/upload', // 仅为示例,非真实的接口地址
filePath: url,
name: 'file',
formData: {
Expand Down

0 comments on commit 11c577c

Please sign in to comment.