Component({ options: { addGlobalClass: true, multipleSlots: true, }, properties: { index: { type: Number, value: 0, }, problemList: { type: Array, }, }, data: { showPreview: false, previewImageUrls: [], previewCurrent: 0, previewTitle: '', previewRemark: '', }, methods: { previewImage(e) { const { index, type } = e.currentTarget.dataset; const previewImageUrls = []; const pro = this.data.problemList[index[0]]; if (type == 'pro') { pro.proPics.forEach(p => { previewImageUrls.push(p); }); } else { pro.changePics.forEach(p => { previewImageUrls.push(p); }); } this.setData({ previewImageUrls, previewCurrent: index[1], showPreview: true, previewTitle: pro.problemname, }); }, }, });