Skip to content

Commit 9f87ff9

Browse files
muronggjuzi214032
authored andcommitted
fix(ImagePicker): 修复无法进行图片预览问题
fix #1021
1 parent f022080 commit 9f87ff9

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/image-picker/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,10 @@ Component({
121121
let tempFilePath = '';
122122
let previewImageList = [];
123123
const newOrOld = this.data.newOrOld;
124+
const cellsIsObject = Object.prototype.toString.call(this.data.cells) === '[object Object]';
124125

125126
// 第一个 if 是对 cells 的兼容处理
126-
if (typeof (this.data.cells) !== 'undefined') {
127+
if (cellsIsObject) {
127128
const cells = this.data.cells;
128129
tempFilePath = cells[index].url;
129130
for (let i = 0; i < cells.length; i++) {

0 commit comments

Comments
 (0)