Skip to content

Commit 9ca2b97

Browse files
committed
fix(imgUpload): 修复插入多文件时数量不准等问题
1 parent c7a9276 commit 9ca2b97

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/components/base/upload-imgs/index.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -821,7 +821,7 @@ export default {
821821
let l = imgInfoList.length
822822
if (this.isStable) {
823823
// 固定数量模式, 按次序插入空项
824-
for (let i = 0, k = 1; i < max || k < l; i += 1) {
824+
for (let i = 0, k = 1; i < max && k < l; i += 1) {
825825
if (itemList[i].status === 'input') {
826826
this.itemList[i] = createItem(imgInfoList[k])
827827
k += 1
@@ -835,7 +835,7 @@ export default {
835835
if (itemList[itemList.length - 1].status === 'input') {
836836
this.itemList.pop()
837837
}
838-
for (let i = 1; i < l; i += 1) {
838+
for (let i = 1; i <= l; i += 1) {
839839
this.itemList.push(createItem(imgInfoList[i]))
840840
}
841841
}

0 commit comments

Comments
 (0)